indicator · on price · open source
ATR Bands indicator
ATR Bands is a free open-source indicator. ATR Bands wrap a smoothed moving average with parallel ATR envelopes — a cleaner ride… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What ATR Bands does
ATR Bands wrap a smoothed moving average with parallel ATR envelopes — a cleaner ride channel than Keltner that uses fixed ATR rather than the KC rolling formula.
- Outer rails are common stop and target levels.
- Slope of the mid line tells you the trend direction.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("ATR Bands", overlay=true)
len = input.int(20, "EMA / ATR length", minval=2, maxval=200)
mult = input.float(2, "ATR multiplier", minval=0.1, maxval=10, step=0.1)
src = input.source(close, "Source")
colorMid = input.color("color.orange", "Color Mid")
colorMid2 = input.color("color.teal", "Color Mid2")
m = ta.rma(src, len)
upper = m + ta.atr(len) * mult
lower = m - ta.atr(len) * mult
p_ATR_Mid = plot(m, "ATR Mid", color=colorMid, linewidth=2)
p_ATR_Upper = plot(upper, "ATR Upper", color=colorMid2)
p_ATR_Lower = plot(lower, "ATR Lower", color=colorMid2)
fill(p_ATR_Upper, p_ATR_Lower, color=color.new(colorMid2, 90))
alertcondition(ta.crossover(close, upper), "Above upper", "Close crossed above the ATR upper band")
alertcondition(ta.crossunder(close, lower), "Below lower", "Close crossed below the ATR lower band")
No comments yet.
Sign in to comment.