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

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?
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)