RicardoSantos

[RS]Intraday Weekly Levels Forecast V0

EXPERIMENTAL:
a different calculation for pivots and forecasting price range forward.
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]Intraday Weekly Levels Forecast V0', shorttitle='IWLF', overlay=true)

w_shift = period == '1' ? 7200 :
         period == '3' ? 2400 :
         period == '5' ? 1440 :
         period == '15' ? 480 :
         period == '30' ? 240 :
         period == '45' ? 160 :
         period == '60' ? 120 :
         period == '120' ? 60 :
         period == '180' ? 40 :
         period == '240' ? 30 :
         period == '480' ? 15 :
         period == '720' ? 10 :
         0
w_atr = security(tickerid, 'W', atr(100))
w_open = security(tickerid, 'W', open)
w_high = security(tickerid, 'W', high)
w_low = security(tickerid, 'W', low)
w_upper = w_high + w_atr
w_lower = w_low - w_atr

plot(title='Weekly Open', series=w_open, color=black)
plot(title='Weekly Upper Extreme', series=w_upper, color=black, offset=w_shift)
plot(title='Weekly Lower Extreme', series=w_lower, color=black, offset=w_shift)
plot(title='Weekly High', series=w_high, color=black, offset=w_shift)
plot(title='Weekly Low', series=w_low, color=black, offset=w_shift)