Golgistain

Pivot Points High/Low

10611 görüntülenme
1399
10611 8
This is my code for something Trading View already gives us -- Pivot Points .
It's not really an indicator in itself, although when weekly highs or lows are broken it seems to be a big deal. I wrote this so I'd have something to play with.

Here’s one way to access previous values:
valuewhen(change(high_series) != 0, high_series, 1)
Favori Komutlardan Çıkart Favori Komutlara Ekle
study(title="Pivot Points HL", shorttitle="Pivots H/L", overlay=true)

//The length defines how many periods a high or low must hold to be a "relevant pivot"
len = input(14, minval=1, title="Length")


//define a series that is equal to the highest value over the last length
highest_high = highest(high, len)
//if that high holds for the full length return the value, else na
highest_dev = dev(highest_high, len) ? na : highest_high
//shift the series to where it started
high_pivot = highest_dev[-len+1]
//create a series which is equal to the last pivot
high_series = fixnan(high_pivot)


//repeated for lows
lowest_low = lowest(low, len)
lowest_dev = dev(lowest_low, len) ? na : lowest_low
low_pivot = lowest_dev[-len+1]
low_series = fixnan(low_pivot)



plot(high_series, color=black, linewidth=2)
plot(low_series, color=black, linewidth=2)
//plot(high_pivot, color=black, style=circles, linewidth=4)
//plot(low_pivot, color=black, style=circles, linewidth=4)
why i cant use it???
Cevap Gönder
Golgistain jesse8108
Just released an update. I wasn't supposed to use negative values in my brackets but got around it by using stored values. TradingView fixed it
+7 Cevap Gönder
locky192 Golgistain
I know this old but I need an indicator exactly like this, this is great! I assume that since you created it an update by tradingview has since broken your code. Any chance you could fix it? It would be greatly appreciated!
+4 Cevap Gönder
Gincha Golgistain
@Golgistain,
Is there any chance, someone could fix it, so it could actually work? I would like to use this indicator! Please! ;)
Cevap Gönder
+2 Cevap Gönder
Gincha Golgistain
@Golgistain,
Thank You! It is working just fine!
Cevap Gönder
Add a Median line and that would really be useful .....(hl2)
Cevap Gönder
Sometimes the less complex the better! Nice addition. Thanks.
Cevap Gönder
Ana Sayfa Hisse Senedi Takipçisi Forex Takipçisi Kripto Takipçisi Ekonomik Takvim Nasıl Çalışır Grafik Özellikleri Ücretlendirme Kurallarımız Moderatörler Web Sitesi & Aracı Kurum Çözümleri Görsel Bileşenler(Widget) Grafik Çözümleri Destek Merkezi Yeni Özellik Talebi Blog ve Haberler SSS Viki Twitter
Profil Profil Ayarları Hesap ve Ödemeler TradingView Koinleri Destek Kayıtlarım Destek Merkezi Yayınlanmış Fikirler Takip Edenler Takip Ediliyor Özel Mesajlar Sohbet Çıkış