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.
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?
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)