RicardoSantos

[RS]Adaptive Range Channel V0

EXPERIMENTAL:
center is based on the mean of price on X bars lookback window, channel width is determined buy maximum volatility from the mean outwards(to the extremes).
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
//@version=2
study(title='[RS]Adaptive Range Channel V0', shorttitle='ARC', overlay=true)
window = input(title='Lookback Window:', type=integer, defval=100)
src = input(title='Source Data:', type=source, defval=close)
//Alternative Version:
//m = na(m[1]) ? close : (percentile_linear_interpolation(close , 100, 50)+m[1])*0.5
m = na(m[1]) ? close : percentile_linear_interpolation(src , window, 50)
t = na(t[1]) ? 0 : max(t[1], high-m)
b = na(b[1]) ? 0 : min(b[1], low-m)

plot(title='+1.000', series=m+t, color=black, linewidth=2)
plot(title='+0.764', series=m+t*0.764, color=maroon, linewidth=1)
plot(title='+0.618', series=m+t*0.618, color=red, linewidth=1)
plot(title='+0.500', series=m+t*0.500, color=orange, linewidth=1)
plot(title='+0.382', series=m+t*0.382, color=gray, linewidth=1)
plot(title='+0.236', series=m+t*0.236, color=silver, linewidth=1)
plot(title='0.000', series=m, color=black, linewidth=2)
plot(title='-0.236', series=m+b*0.236, color=silver, linewidth=1)
plot(title='-0.382', series=m+b*0.382, color=gray, linewidth=1)
plot(title='-0.500', series=m+b*0.500, color=olive, linewidth=1)
plot(title='-0.618', series=m+b*0.618, color=lime, linewidth=1)
plot(title='-0.764', series=m+b*0.764, color=green, linewidth=1)
plot(title='-1.000', series=m+b, color=black, linewidth=2)