EXPERIMENTAL:
a different calculation for pivots and forecasting price range forward.
a different calculation for pivots and forecasting price range forward.
//@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)