accidentje

4/2 pivot levels

Plots...
  • Confirmed highs when 1. it's higher than the 4 prior (lower) highs AND 2. higher than the 2 following (lower) highs.
  • Confirmed lows when 1. it's lower than the 4 prior (higher) lows AND 2. lower than the 2 following (higher) lows.
Open-source Skript

Ganz im Spirit von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es besser verstehen und überprüfen können. Herzlichen Glückwunsch an den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Veröffentlichung unterliegt den Hausregeln. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.

Möchten Sie dieses Skript auf einem Chart verwenden?
study(title="4/2 pivot levels", shorttitle="4/2 pivot", overlay=true)
//
useAlternativeTF = input(false)
AlternativeTF = input("W")
tf = useAlternativeTF ? AlternativeTF : period
//
h0 = security(tickerid, tf, high[0])
h1 = security(tickerid, tf, high[1])
h2 = security(tickerid, tf, high[2])
h3 = security(tickerid, tf, high[3])
h4 = security(tickerid, tf, high[4])
h5 = security(tickerid, tf, high[5])
h6 = security(tickerid, tf, high[6])

l0 = security(tickerid, tf, low[0])
l1 = security(tickerid, tf, low[1])
l2 = security(tickerid, tf, low[2])
l3 = security(tickerid, tf, low[3])
l4 = security(tickerid, tf, low[4])
l5 = security(tickerid, tf, low[5])
l6 = security(tickerid, tf, low[6])
//
pivoth = h2 > h1 and h2 > h0 and h6 < h2 and h5 < h2 and h4 < h2 and h3 < h2 ? h2 : pivoth[1]
pivotl = l1 < l0 and l2 < l0 and l6 > l2 and l5 > l2 and l4 > l2 and l3 > l2 ? l2 : pivotl[1]
//
plot(pivoth, color= pivoth != pivoth[1] ? na : red, linewidth=2)
plot(pivotl, color= pivotl != pivotl[1] ? na : green, linewidth=2)