Golgistain

Pivot Points H/L (fix)

1985 6 371
Fixed the previous version which, when TradingView updated, resulted in an error.
A mid-line could be plotted with (hpivot+lpivot)/2

*Oops plotted some gann fans with the script, the script you are looking at is the faint lines in the background
Remove from Favorite Scripts Add to Favorite Scripts
study(title="Pivot Points H/L", shorttitle="Pivots H/L", overlay=true)
len = input(14, minval=1, title="Length")
    //The length defines how many periods a high or low must hold to be a "relevant pivot"

h = highest(len)
    //The highest high over the length
h1 = dev(h, len) ? na : h
    //h1 is a pivot of h if it holds for the full length
hpivot = fixnan(h1)
    //creates a series which is equal to the last pivot

l = lowest(len)
l1 = dev(l, len) ? na : l
lpivot = fixnan(l1)
    //repeated for lows

plot(hpivot, color=blue, linewidth=2, offset= -len+1)
plot(lpivot, color=purple, linewidth=2, offset= -len+1)
//plot(h1, color=black, style=circles, linewidth=4, offset= -len+1)
//plot(l1, color=black, style=circles, linewidth=4, offset= -len+1)
any way you could modify to include the mid-line - i'm not a programmer.

Thx!
Reply
Good Implementation of the fixnan ( )
Reply
JRG ucsgears
Can you program the PyraPoint? That would be awesome. Thx for this pivot script
Reply
How can I use it in my charts?
Reply
Golgistain greenplay
Add to Favorite Scripts at the top right of the code. If you were attracted by the gann fans you can get to those from the drawing tools, they're in the same section as the pitchfork.
Reply
greenplay greenplay
Thanks for posting it. I copied to my charts and it is awesome.
Reply
United States
United Kingdom
India
Deutschland
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
Malaysia
日本
한국
中国
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing Priority Support Ideas Published Followers Following Private Messages Chat Sign Out