VolatilityReference · Indicator Library

ATR

Average True Range

A non-directional measure of volatility: the average size of the bar-to-bar true range over a chosen lookback.

ATR is a non-directional volatility indicator that measures the average size of recent bar ranges. Developed by J. Welles Wilder, it uses 'true range' (which accounts for gaps) and smooths it over 14 bars by default. Used for stop-loss sizing, position sizing, and volatility-regime filtering — not for direction.

Average True Range, introduced by J. Welles Wilder, measures volatility by averaging the true range over N bars (typically 14). True range itself is the greatest of: current high minus current low, the absolute value of current high minus previous close, and the absolute value of current low minus previous close.

ATR tells you nothing about direction — only about how much the asset is moving on average. That makes it the workhorse of risk management: position sizing, stop-loss placement, take-profit targets, and volatility-regime filtering. It also pairs well with any directional indicator to size trades dynamically to current conditions.

How do I read ATR?

  • ATR rising = volatility expanding. Common at trend starts, news events, and breakouts.
  • ATR falling = volatility contracting. Common in late-stage trends, consolidation phases, and overnight sessions.
  • ATR is in price units — for SPY at $400, ATR(14) might be $4 (1% daily range). Compare ATR to price level for percentage volatility.
  • ATR is non-directional. A rising ATR does not mean rising price — it means rising bar size in either direction.
  • Multi-bar ATR lows often precede expansion moves. ATR at a 60-bar low is a coiled-spring volatility regime worth watching for breakouts.
  • Use ATR multiples to set adaptive stops: a 2× ATR stop scales with the asset's recent volatility, unlike a fixed-percentage stop.

How is ATR calculated?

ATR averages the true range over a chosen lookback period. True range is the largest of three measurements that account for both within-bar movement and gap risk.

  1. 1.For each bar, compute True Range (TR) as the maximum of: (high − low), |high − previous close|, and |low − previous close|.
  2. 2.The absolute-value terms ensure gaps are captured — if a stock gaps up overnight, TR includes the gap.
  3. 3.Smooth True Range with 14-bar Wilder smoothing (RMA in Pine Script) to get ATR.
  4. 4.ATR is non-directional: a high value means large bars (volatile market), low means small bars (calm). It says nothing about direction.
  5. 5.Multiply ATR by 1.5–3 to size stops or take-profit targets that adapt to current volatility.

What are the default ATR settings?

ParameterDefaultWhen to adjust
Length14Wilder's original setting. Drop to 7 for faster volatility adaptation; raise to 21 for smoother readings on noisy assets.
Smoothing methodWilder (RMA)Pine's ta.atr() uses Wilder's smoothing by default. Custom EMA-based ATRs produce different (faster) values.
Stop multiplier1.5–3.0Common range for ATR-based stops. Tighter (1.5) for quick scalp trades; wider (3.0) for trend-following positions.
Take-profit multiplier2.0–5.0Set risk-reward target as multiple of ATR. 2× ATR target is conservative; 5× is for trend riders.

How do I plot ATR in Pine Script?

//@version=5
indicator("ATR Example", overlay=false)

length   = input.int(14,  title="Length", minval=1)
multStop = input.float(2.0, title="Stop Multiplier", minval=0.1, step=0.1)

atrValue = ta.atr(length)

plot(atrValue, title="ATR", color=color.purple, linewidth=2)

// Position-sizing reference (in price units):
// stopDistance = atrValue * multStop
// e.g., long entry at close, stop = close - stopDistance

Pine's ta.atr() returns ATR directly — it bundles the True Range calculation and Wilder smoothing internally. ATR plots as a single line in its own pane. To use it for stops, multiply by your chosen multiplier and subtract from entry price. The commented lines show the pattern most strategies use for ATR-based stop placement.

Continue exploring

Related indicators

Browse all indicators

About this reference

This page is an educational reference explaining what ATR is, how it is calculated, its default settings, and how to plot it in Pine Script. It is compiled from established trading literature and public technical documentation. Last review: .

Educational content. Not financial advice.