All indicators

Average True Range

By LuxAlgoApr 13, 2020

Average True Range is an indicator on Vela, our next-generation charting platform, written in Pine Script®.

Static chart image

The Average True Range distills each bar's movement into a single volatility reading: the true range (the largest of the high-low span and the two distances from the prior close) averaged over a lookback. Measuring from the prior close captures gap moves a bare high-minus-low span would ignore, Wilder's reason for defining it this way. The build plots the classic 14-period ATR with a smoothing selector (Wilder's RMA default, plus SMA, EMA, and WMA), the standard, unaltered calculation.

How to Trade the Average True Range?

  • Rising ATR: ranges are expanding. Moves travel farther, stops need more room, and position sizes should shrink to keep risk constant.
  • Falling ATR: contraction. Tighter stops become viable, and compressed readings are where breakout traders start paying attention.
  • Stops in ATR multiples: an ATR-sized buffer past entry or structure adapts the exit to current conditions instead of a fixed tick count.
  • Sizing by ATR: dividing the account risk per trade by an ATR-based stop distance normalizes exposure across instruments and regimes.
  • ATR spikes: sudden jumps mark event-driven volatility, after which recent readings, not older ones, define what a normal distance means.

ATR is direction-blind and denominated in price units: a waterfall decline expands it just as a powerful advance does; a reading only means something against the instrument's recent history.

Average True Range Settings

  • Length (default 14): the number of bars averaged. Shorter lengths track regime shifts quickly but jump around; longer lengths give a stabler baseline for stops and sizing.
  • Smoothing (default RMA): the moving average applied to the true range. RMA is Wilder's original smoothing and produces the classic ATR; SMA weighs all bars equally; EMA and WMA lean toward recent bars and react faster.

Frequently Asked Questions

Free to use

Run it on Vela. Go further with a paid plan.

  • Up to 500 Custom Alerts, with webhook automation
  • Up to 10× the chart history of Free
  • Orderflow lookback up to full history
  • More Quant usage to customize it, plus extra usage when you need it
  • Futures data alongside crypto, stocks, forex and commodities
See plans
Original indicatorBuilt in-house by LuxAlgo
All 3 ATR indicators

Run it on Vela. Make it yours with Quant.

Open this indicator free on Vela, our next-generation charting platform. Then ask Quant, our coding agent built into Vela, to retune it or turn it into a backtested strategy of your own.