ATR (Average True Range)

A volatility indicator that measures the average range of price movement over a period, used for stop losses and position sizing.

ATR indicator applied to the Germany 30 15-minute chart showing volatility spikes
ATR (14) applied to the Germany 30 15-minute chart. The sharp ATR spike corresponds to a large directional move, while declining ATR readings indicate volatility compression.

ATR measures volatility — not direction. It calculates the average "true range" over N bars, where true range is the largest of: current high minus current low, current high minus the previous close, and current low minus the previous close. Including the previous close means gaps are captured, not ignored.

The output is in price units. On EURUSD, an ATR of 0.0050 means the pair has been moving about 50 pips per bar on average. On SPY, an ATR of 5.00 means roughly $5 of typical daily range. That absolute context is what makes it useful for calibrating stops and targets to the actual instrument.

How traders use it

### ATR-based stop losses Fixed-point stops (e.g. "20 ticks") are fragile. They're too tight on volatile instruments and too loose on calm ones. A stop at 1.5× ATR adapts automatically — it gives the trade room to breathe in proportion to how much that instrument normally moves.

### Position sizing If you know your stop is 1× ATR away and you want to risk $200 per trade, the position size is $200 / (ATR × point value). This is how systematic traders ensure consistent risk across all positions regardless of which instrument or timeframe.

### Trailing stops Use ATR to trail: move the stop up to 2× ATR below the running high on longs. The stop widens in volatile conditions and tightens when the market calms. Supertrend is essentially this logic made visual.

### Volatility regime detection A declining ATR means compression — the market is coiling. A sudden ATR expansion often accompanies a breakout. Comparing current ATR to a longer-period ATR average is a clean way to detect whether a breakout has real volatility behind it.

//@version=6
indicator("ATR Demo", overlay=true)

atrPeriod  = input.int(14,   "ATR Period",      minval=1)
stopMult   = input.float(1.5, "Stop Multiple",  minval=0.1, step=0.1)
targetMult = input.float(3.0, "Target Multiple",minval=0.1, step=0.1)

atrValue    = ta.atr(atrPeriod)
stopLevel   = close - atrValue * stopMult
targetLevel = close + atrValue * targetMult

// ATR trailing stop (tracks running high)
var float trailStop = na
trailStop := math.max(nz(trailStop, close - atrValue * 2), close - atrValue * 2)

plot(stopLevel,   "Stop",    color=color.red,   linewidth=1, style=plot.style_circles)
plot(targetLevel, "Target",  color=color.green, linewidth=1, style=plot.style_circles)
plot(trailStop,   "Trail",   color=color.orange,linewidth=1)

// Show ATR value in data window
plot(atrValue, "ATR", display=display.data_window)

Key takeaway: ATR says nothing about direction, but it may be the single most useful indicator for building robust strategies. Fixed-point stops become obsolete the moment you change instruments or timeframes. ATR-based stops and targets travel with you — they adapt to the instrument's own volatility automatically. Pair it with Bollinger Bands® or Donchian Channels for entries; use ATR exclusively for exits and sizing.