IvanLabrie

Moving averages and bands

I coded this simple indicator based on multiple ideas shared by Tim West at his "Key Hidden Levels" chatroom.

  • We have a moving average ribbon comprised of the average of the highs and lows in 10 periods. The colored space in between acts more or less like fair value and is often where price is when consolidating.
  • Green and red triangles at the top and bottom of the screen.
    The ones at the bottom, correspond to signals obtained from a 4 period moving average of the close's slope. It helps get excellent exits for trending moves by changing color with the moving average slope.
    The ones at the top, are green while Bollinger Band Width increases, and red while it decreases, relative to the previous bar.
  • Background color highlights when the close moves over the moving average of the highs or under the moving average of the lows, indicating a change of trend is possible, or at least a pause/consolidation.
The idea is to have multiple reasons to stay in a trade, which is normally very hard to do, specially when winning.

Cheers,
Ivan Labrie

Time at Mode FX

🔒Want to dive deeper? Check out my paid services below🔒

linktr.ee/ivanlabrie
Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?
study(title="Moving averages and bands", overlay=true)
//10 period high and low sma's
highma = sma(high, 10)
lowma = sma(low, 10)
bull=crossover(close,highma)
bear=crossunder(close,lowma)
//4 period MA slope
avg = sma(close,4)
avgup = avg >= avg[3]
avgdown = avg < avg[3]
//Bollinger Bands and Bollinger Bands' Width
basis = sma(close, 21)
dev = stdev(close, 21)
upper = basis + (2*dev)
lower = basis - (2*dev)
bbw = (upper - lower)/basis
bbwup = bbw >= bbw[3]
bbwdown = bbw < bbw[3]
//plots
p1=plot(highma, color = green, linewidth=2, style=line, transp=50)
p2=plot(lowma, color = maroon, linewidth=2, style=line, transp=50)
fill(p1, p2, color=green)

p3=plotshape(avgup, style=shape.triangleup, color=green,location=location.bottom)
p4=plotshape(avgdown, style=shape.triangledown, color=red, location=location.bottom)

p5=plot(upper, linewidth=2, style=line, transp=70, color=teal)
p6=plot(lower, linewidth=2, style=line, transp=70, color=teal)
fill(p5, p6, color=white)

p7=bgcolor(bull ? green : na, transp=90)
p8=bgcolor(bear ? red : na, transp=90)

p9=plotshape(bbwup, style=shape.triangleup, color=green,location=location.top)
p10=plotshape(bbwdown, style=shape.triangledown, color=red, location=location.top)