The average size of recent price ranges, accounting for gaps. Probably the single most-cited indicator across the rest of this guide — used as the input to stop placement, position sizing, regime detection, and most ATR-derived indicators (Supertrend, Keltner Channel, volatility-scaled exits). Developed by Welles Wilder in 1978.
ATR(14) on MES 5m — calm to volatile transition
What it measures
- Average price range. How many points (or dollars) a typical bar moves over the lookback period.
- Volatility, not direction. ATR rises during volatile expansion in either direction. It says nothing about whether the market is going up or down.
- Gap-aware. Unlike simple high-minus-low, the True Range calculation accounts for overnight gaps — a gap up that opens above yesterday's high is still part of today's "range."
Formula
How AlgoLift computes it
Step 1 — True Range per bar:
TR = max(
High − Low,
|High − PreviousClose|,
|Low − PreviousClose|
)
The three candidates capture: (1) today's range, (2) the gap up scenario (prev close below today's range), (3) the gap down scenario (prev close above today's range). True Range is the largest of the three.
Step 2 — smoothed average:
ATR = Wilder-smoothed average of TR over `period` bars
Wilder's smoothing is a special EMA where the weighting factor is 1 / period instead of the usual 2 / (period + 1) — slower than a same-period EMA, smoother than an SMA.
Inputs in AlgoLift
| Setting | Default | Range | Notes |
|---|---|---|---|
| Period | 14 | 1–500 | Lookback for averaging the True Range. |
Recommended periods
- 5–7 (fast): Short-term volatility readings — useful for very-low-timeframe trading.
- 14 (default): Wilder's original. Works across timeframes.
- 20–22: Slower — for swing trading and volatility regime classification.
Outputs in AlgoLift
| Handle | Type | Plotted | Notes |
|---|---|---|---|
| ATR Value | Numeric | Always | The average True Range — in price points/dollars/cents matching the instrument's units. |
| Slope | Numeric | On select | Bar-over-bar change in ATR. Rising = volatility expanding; falling = volatility contracting. |
ATR node — default state
How to read it
- ATR rising: Volatility is expanding. Either prices are making bigger moves or gaps are opening.
- ATR falling: Volatility is contracting. Quieter range-bound conditions.
- ATR persistent and high: Sustained volatile regime — wider stops needed; smaller positions justified.
- ATR persistent and low: Calm regime — tighter stops viable; range strategies favored.
- Spike in ATR slope: A volatility event just happened (news, gap, large bar) — stop systems often need to widen quickly.
ATR is not a directional indicator. Don't try to read trend from it. The output is a magnitude only.
ATR's value isn't in showing you what to trade — it's in scaling everything else. Position sizing, stop distance, target distance, breakout filters, regime detection — all of them work better when calibrated to ATR than to fixed numbers. If you only use one volatility indicator in your strategies, this is the one.
Best in / worst in
Best in any instrument and timeframe where volatility changes meaningfully over time — which is essentially every market. ATR is one of the few indicators with no instrument-specific weakness.
Worst in none, really. The only failure mode is misusing ATR — treating it as a direction signal, or using a too-short period that produces noisy readings.
Three setups
1. ATR-scaled stop loss
The signature ATR pattern. Set stops at N × ATR distance from entry.
- Long: Entry at $X. Stop loss at
X − 1.5 × ATR(14). - Short: Stop loss at
X + 1.5 × ATR(14).
Wider in volatile sessions, tighter in calm ones — automatically. The multiplier (1.0 to 3.0 are common) depends on the strategy's holding time and how much noise you want the stop to absorb.
ATR-scaled stop loss — entry minus 1.5×ATR
2. ATR-based position sizing
Calculate position size from per-trade risk and stop distance — both involve ATR.
- Risk per trade: Account equity × 1%.
- Stop distance: 1.5 × ATR.
- Position size:
risk_per_trade / (stop_distance × point_value).
The math automatically gives you smaller positions in volatile conditions and larger positions in calm ones — keeping dollar risk constant across regimes. See position sizing for the full math.
3. ATR regime classifier
Use ATR's level (compared to its own history) as a volatility regime flag.
- High vol regime: Current ATR > 1.5 × ATR's 50-bar average.
- Low vol regime: Current ATR < 0.6 × ATR's 50-bar average.
- Normal: In between.
Use to gate strategies — mean-reversion in low vol, trend-following in high vol, both off during transitions. See market regimes.
Advanced patterns in AlgoLift
Volatility-scaled targets. Mirror the stop-loss pattern on the profit side via Set Target Profit. A 2:1 RR strategy becomes: stop at entry − 1.5×ATR, target at entry + 3.0×ATR. Both adjust to current volatility automatically.
ATR slope as a "trade conditions changing" alert. Use Set User Variable to track ATR's value. When ATR slope > some threshold for N consecutive bars, the volatility regime is shifting — pause new entries or tighten stops. The change-detection is sometimes more useful than the absolute level.
Per-instrument ATR for portfolio sizing. Each strategy in a portfolio uses its own instrument's ATR for sizing. Combined with fixed-fractional risk, this means a portfolio of strategies on ES, NQ, GC, and CL all contribute equal dollar-risk despite very different point values and volatility profiles. The cleanest single technique for cross-instrument portfolios.
Multi-timeframe ATR for context. Add a daily ATR alongside your 5m execution. Use the daily ATR to set position size (volatility-of-the-week sizing) and the 5m ATR for stop distance (volatility-of-the-hour stops). Two timeframes, two different ATR jobs. See the multi-series Visual Builder pattern.
Multi-timeframe ATR — daily for sizing, 5m for stops
Common mistakes
- Reading ATR as a direction indicator. It isn't. ATR rises during both bull rallies and bear crashes. Combine with a direction tool (EMA slope, Supertrend Direction, etc.).
- Using fixed point stops on volatile instruments. A 10-point stop on MES means something very different at 1% daily ATR vs. 3% daily ATR. ATR-scaled stops fix this completely.
- Choosing the multiplier without testing. "1.5×ATR" is a common default, but the right multiplier depends on the strategy's hold time. Quick scalps want tight (0.5–1.0×); swing trades want wide (2.5–4.0×). Test what the strategy actually needs.
- Using too short a period. ATR(3) is noise. ATR(5) is almost noise. The shortest useful period is around 7; below that the smoothing isn't doing its job.