finn

Dynamic Pivots

541 5 80
Shows various traditional pivots and hides the daily and weekly when you're watching in higher time frames. It also shows you the previous sessions highs and lows. In addition the developing pivots , high and low in the current session are also displayed.
Remove from Favorite Scripts Add to Favorite Scripts
study(title="Dynamic Pivots", overlay=true)

isMicroTF = (isintraday and interval < 30)

daily       = security(tickerid,"D",   hlc3[1])
weekly      = security(tickerid,"W",   hlc3[1])
monthly     = security(tickerid,"M",   hlc3[1])
yearly      = security(tickerid,"12M", hlc3[1])
dailyLow    = security(tickerid,"D",   low[1])
dailyHigh   = security(tickerid,"D",   high[1])

//Traditional Pivot
plot((isintraday and interval < 180 ? daily  : na),  color=#CC33FF, title="Daily",   style = circles, linewidth = 2, transp=0)
plot((isintraday                    ? weekly : na),  color=#F500B8, title="Weekly",  style = circles, linewidth = 2, transp=0)
plot(monthly,                                        color=#6633FF, title="Monthly", style = circles, linewidth = 2, transp=0)
plot(yearly,                                         color=#B8008A, title="Yearly",  style = circles, linewidth = 2, transp=0)

//Also plot previous session high and low
plot((isintraday and interval < 180 ? dailyLow  : na),  color=red, title="High",   style = circles, linewidth = 1, transp=25)
plot((isintraday and interval < 180 ? dailyHigh : na),  color=lime, title="Low",   style = circles, linewidth = 1, transp=25)

//Previous pivot extended
daily2       = security(tickerid,"D",   hlc3[2])
weekly2      = security(tickerid,"W",   hlc3[2])
monthly2     = security(tickerid,"M",   hlc3[2])
yearly2      = security(tickerid,"12M", hlc3[2])

plot((isintraday and interval < 180 and isMicroTF ? daily2  : na),  color=#CC33FF, title="Daily",   style = circles, linewidth = 2, transp=60)
plot((isintraday                    ? weekly2 : na),  color=#F500B8, title="Weekly",  style = circles, linewidth = 2, transp=60)
plot(monthly2,                                        color=#6633FF, title="Monthly", style = circles, linewidth = 2, transp=60)
plot(yearly2,                                         color=#B8008A, title="Yearly",  style = circles, linewidth = 2, transp=60)

//Daily pivot second extension
daily3       = security(tickerid,"D",   hlc3[3])
weekly3      = security(tickerid,"W",   hlc3[3])
monthly3     = security(tickerid,"M",   hlc3[3])
yearly3      = security(tickerid,"12M", hlc3[3])

plot((isintraday and interval < 180 and isMicroTF ? daily3  : na),  color=#CC33FF, title="Daily",   style = circles, linewidth = 2, transp=70)
plot((isintraday                    and isMicroTF ? weekly3 : na),  color=#F500B8, title="Weekly",  style = circles, linewidth = 2, transp=70)
plot(monthly3,                                        color=#6633FF, title="Monthly", style = circles, linewidth = 2, transp=70)
plot(yearly3,                                         color=#B8008A, title="Yearly",  style = circles, linewidth = 2, transp=70)

//Current Pivot in development
daily0       = security(tickerid,"D",   hlc3[0])
weekly0      = security(tickerid,"W",   hlc3[0])
monthly0     = security(tickerid,"M",   hlc3[0])
yearly0      = security(tickerid,"12M", hlc3[0])
dailyLow0    = security(tickerid,"D",   low[0])
dailyHigh0   = security(tickerid,"D",   high[0])

plot((isintraday and interval < 180 and isMicroTF ? daily0  : na),  color=#CC33FF, title="Daily",   style = circles, linewidth = 1, transp=50)
plot((isintraday                    and isMicroTF ? weekly0 : na),  color=#F500B8, title="Weekly",  style = circles, linewidth = 1, transp=50)
plot(monthly0                       and isMicroTF,                  color=#6633FF, title="Monthly", style = circles, linewidth = 1, transp=50)
plot(yearly0                        and isMicroTF,                  color=#B8008A, title="Yearly",  style = circles, linewidth = 1, transp=50)

//Also plot previous session high and low
plot((isintraday and interval < 180 and isMicroTF ? dailyLow0  : na),  color=red, title="High",   style = circles, linewidth = 1, transp=60)
plot((isintraday and interval < 180 and isMicroTF ? dailyHigh0 : na),  color=lime, title="Low",   style = circles, linewidth = 1, transp=60)






Thank you for this one , can we use this one for forex pairs as well ?
Reply
finn Ede
Yes, it should work on any pair
+1 Reply
I had a pivot move when I refreshed the page and the candle hadn't closed yet.
Reply
Had a pivot move*
Reply
finn ElmerFUD
It shows you the developing pivots in the current session as well when your time frame is below 30 minutes, they tend to move. For example, if you leave the chart open for a while and the price moves you will also see the current pivots move as well. These developing pivots will just have a much lighter color. Please adjust the colors and transparencies to something that fit's your mindset. If you need to turn pivots off just put a // in front of the 'plot' that plots it. I might make this stuff configurable in the longer term, just wanted to get the script out :)
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Forex Signal Finder 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 Account and Billing Sign Out