Indicators··6 min read

ATR-Based Volatility Bands

4 references, link-verified · 2 primaryEditor of record: Shane CantyStandards review editorial standard · audit log

ATR-based volatility bands are dynamic price bands that expand and contract with market volatility, calculated by placing upper and lower bands a fixed multiple of the Average True Range away from a central moving average. Traders use these bands to identify potential support and resistance zones, recognize volatility regime shifts, and spot price extremes relative to recent trading range. This approach is particularly useful on higher timeframes where ATR captures overnight gaps and multi-session moves that simple standard deviation measures may miss.

//@version=6
indicator("ATR-Based Volatility Bands", overlay=true)

// Inputs
length_atr = input.int(14, title="ATR Period", minval=1)
length_ma = input.int(20, title="MA Period", minval=1)
ma_type = input.string("SMA", title="MA Type", options=["SMA", "EMA", "RMA"])
multiplier = input.float(2.0, title="Band Multiplier", minval=0.1, step=0.1)

// Calculate ATR
atr_value = ta.atr(length_atr)

// Calculate moving average based on user selection
ma = 
  ma_type == "EMA" ? ta.ema(close, length_ma) :
  ma_type == "RMA" ? ta.rma(close, length_ma) :
  ta.sma(close, length_ma)

// Calculate bands
upper_band = ma + (atr_value * multiplier)
lower_band = ma - (atr_value * multiplier)

// Plot
plot(ma, title="Midline", color=color.blue, linewidth=1)
plot(upper_band, title="Upper Band", color=color.green, linewidth=1, style=plot.style_dashed)
plot(lower_band, title="Lower Band", color=color.red, linewidth=1, style=plot.style_dashed)

// Fill between bands
fill(plot(upper_band, display=display.none), 
     plot(lower_band, display=display.none), 
     color=color.new(color.gray, 90), title="Band Fill")

How the code works

The indicator begins by computing the Average True Range over a user-defined period (default 14 bars), which measures the average of true price movements including gaps and opens. The true range accounts for overnight jumps and significant directional moves, making ATR a volatility measure independent of direction.

A central moving average is calculated across the same lookback period using the trader's chosen method: simple moving average (SMA) for unweighted smoothing, exponential moving average (EMA) for recent price emphasis, or relative moving average (RMA, also called Wilder's smoothing) as a compromise. This midline serves as a reference anchor.

The upper and lower bands are then positioned at fixed multiples of ATR above and below the midline. A multiplier of 2.0 places bands two ATR units away; higher multipliers widen the bands for less frequent touches, while lower multipliers narrow them for more sensitive reaction. The bands are plotted as dashed lines with the midline solid for visual clarity, and a semi-transparent fill between the bands emphasizes the volatility envelope.

Critically, the indicator uses only lookback data and produces no repainting: each bar's ATR is calculated from historical closes, and past band positions remain fixed when new bars arrive.

Reading it on a chart

On a typical chart, the midline tracks the price trend with a lag consistent with the moving average period. The bands widen during high-volatility periods (market stress, earnings, macro events) and narrow during quiet, range-bound sessions. Price touches or penetrations of the bands have different meanings depending on context.

When price closes outside the upper band after a sustained advance, it may signal an overbought extreme or breakout validation, depending on whether the move was already well-established or just beginning. Conversely, price pushing below the lower band can indicate an oversold bounce opportunity or continuation of weakness. During consolidations, bands tighten, offering traders a visual signal that volatility has compressed and a breakout may be imminent.

The relationship between price and the midline provides trend context: closing consistently above the midline suggests uptrend strength, while closes below suggest weakness. Band squeezes (when ATR drops sharply) precede volatility expansion; traders watching this compression often prepare for directional moves.

A key observation is that the bands themselves do not generate buy or sell signals automatically; they define a volatility zone. A swing trader might buy a dip to the lower band within an uptrend, while a breakout trader might wait for price to close and hold above the upper band after a band squeeze.

Limitations

ATR-based volatility bands inherit fundamental limitations from their components. First, ATR is a volatility measure, not a trend or momentum indicator. High volatility does not predict direction, only the magnitude of price swings; a volatile market can fall as easily as rise. Relying on band width alone to forecast breakouts will produce frequent false signals.

Second, the bands lag price because they are centered on a moving average. During fast directional moves, price may travel far beyond the bands before the moving average catches up, creating the illusion of extremes when none exist. On fast 1-minute charts, this lag becomes severe.

Third, the multiplier choice is arbitrary. No statistical foundation governs optimal multiplier values across instruments or timeframes. A multiplier of 2.0 that fits one equity may be too loose on a volatile small-cap or too tight on a steady index. Testing is required per instrument and timeframe.

Fourth, overnight gaps and limit moves can make ATR spikes that render the bands uselessly wide for one or two bars before settling. This is especially pronounced on instruments with low daily volume or sudden news-driven moves.

Finally, these bands offer no edge without additional confluence. Price often coils inside bands for extended periods, and traders who trade band touches without confirmation from structure, momentum, or volume often suffer whipsaw losses. The bands work best as a volatility context layer, not as a standalone entry system.

Key definitions

Average True Range (ATR): A volatility indicator that measures the average distance between the high and low of each bar, including gaps from the previous close, over a specified period.

Moving Average: A smoothed trend line calculated as the arithmetic mean (SMA), exponential-weighted average (EMA), or other weighted average of prices over a lookback period.

Volatility Band: A pair of lines placed above and below price, typically centered on a moving average, used to visualize the dynamic range of price swings.

Multiplier: A scaling factor applied to ATR to set the distance of bands from the midline; higher multipliers produce wider bands.

Repainting: A charting behavior in which past indicator values change when new price data arrives, undermining backtesting integrity; this indicator avoids repainting by using only closed, historical bar data.

References

  1. Wilder, J.W., "New Concepts in Technical Trading Systems", Trend Research (1978).
  2. CME Group, "Volatility Measurement", https://www.cmegroup.com/education.html
  3. TradingView, "Pine Script Reference v6", https://www.tradingview.com/pine-script-docs/
  4. Investopedia, "Average True Range (ATR): Definition and Uses", https://www.investopedia.com/terms/a/atr.asp
  5. CFTC, "Volatility in Commodity Markets", https://www.cftc.gov/

Educational research on historical data only. Not investment advice, not a signal, and never a performance promise. Past results do not predict future performance. Every reference is link-verified before publication and every paper is re-audited weekly against the library's editorial standard.

Last reviewed by the PropLedger research pipeline: 2026-09-13. Educational research on historical data, not financial advice.

Educational research on historical data only. Not investment advice, not a signal, and never a performance promise. Past results do not predict future performance. Every reference is link-verified before publication and every paper is re-audited weekly against the library's editorial standard. Found an error? Email support@prop-ledger.org and the paper is corrected or withdrawn.