OPEN-SOURCE SCRIPT

Closing Price Donchian Channels Rayner

79
//version=5
indicator("Closing Price Donchian Channels", overlay=true)

// Input parameters
length = input.int(20, "Period", minval=1)
showMid = input.bool(true, "Show Middle Line")

// Calculate upper and lower bands based on closing prices
upper = ta.highest(close, length)
lower = ta.lowest(close, length)
mid = (upper + lower) / 2

// Plot the bands
upperBand = plot(upper, "Upper Band", color=color.rgb(0, 184, 222))
lowerBand = plot(lower, "Lower Band", color=color.rgb(0, 184, 222))
midLine = plot(showMid ? mid : na, "Middle Line", color=color.rgb(209, 212, 220))

// Fill the area between bands
fill(upperBand, lowerBand, color=color.rgb(0, 184, 222, 90), title="Channel Fill")

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.