RicardoSantos

[RS]Shifted Pivots V0

357 0 36
request for FUSEFOREX:
ability to display forming next day pivots(some manual refreshing required)
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study(title='[RS]Shifted Pivots V0', shorttitle='SP', overlay=true)
d_shift = period == '1' ? 1440 :
         period == '3' ? 480 :
         period == '5' ? 288 :
         period == '15' ? 96 :
         period == '30' ? 48 :
         period == '45' ? 32 :
         period == '60' ? 24 :
         period == '120' ? 12 :
         period == '180' ? 8 :
         period == '240' ? 6 :
         period == '480' ? 3 :
         period == '720' ? 2 :
         0

d_open = security(tickerid, 'D', open)
d_high = security(tickerid, 'D', high)
d_low = security(tickerid, 'D', low)
d_close = security(tickerid, 'D', close)

d_pivot = security(tickerid, 'D', hlc3)

d_resistance1 = (d_pivot * 2) - d_low
d_support1 = (d_pivot * 2) - d_high

d_resistance2 = (d_pivot - d_support1) + d_resistance1
d_support2 = d_pivot - (d_resistance1 - d_support1)

d_resistance3 = (d_pivot - d_support2) + d_resistance2
d_support3 = d_pivot - (d_resistance2 - d_support2)

plot(title='P', series=d_pivot, color=change(d_pivot)!=0?na:black, offset=d_shift)
plot(title='R1', series=d_resistance1, color=change(d_resistance1)!=0?na:black, offset=d_shift)
plot(title='S1', series=d_support1, color=change(d_support1)!=0?na:black, offset=d_shift)
plot(title='R2', series=d_resistance2, color=change(d_resistance2)!=0?na:black, offset=d_shift)
plot(title='S2', series=d_support2, color=change(d_support2)!=0?na:black, offset=d_shift)
plot(title='R3', series=d_resistance3, color=change(d_resistance3)!=0?na:black, offset=d_shift)
plot(title='S3', series=d_support3, color=change(d_support3)!=0?na:black, offset=d_shift)
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out