tmr0

Relative True Range

Dots show the total movement for the period as a percentage (profit potential).
Line shows the volatility of the period in relation to the beginning of the period.
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?
//coded by tmr0
//точки показывают суммарное движение за период в процентах (потенциальная прибыль)
//линия показывает волатильность за период по отношению к началу периода
// dots show the total movement for the period as a percentage (profit potential)
// line shows the volatility of the period in relation to the beginning of the period

study(title="Relative True Range", shorttitle="tRTR", overlay=false, precision=1)
res = input("D", type=resolution)
len = input(20, minval=1)

y0 = (highest(len)-lowest(len))/hl2[len-1]*100
y = security(tickerid, res, y0)
z1= (high-low)/open
z0 = sum(z1, len)*100
z = security(tickerid, res, z0)

plot(z, color=purple, style=circles, transp=0, linewidth=2)
plot(y, color=y>50?red:y>25?orange:y>10?green:blue, style=area, transp=60)

hline(0, linestyle=dotted, color=blue)
hline(10, linestyle=dotted, color=green)
hline(25, linestyle=dotted, color=orange)
hline(50, linestyle=dotted, color=red)