Pivot Points H/L (fix)

3170 7 697
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)
Very nice.
any way you could modify to include the mid-line - i'm not a programmer.

Good Implementation of the fixnan ( )
JRG ucsgears
Can you program the PyraPoint? That would be awesome. Thx for this pivot script
How can I use it in my charts?
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.
greenplay greenplay
Thanks for posting it. I copied to my charts and it is awesome.
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out