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).
Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?
//@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)