volatility indicator
ATR backtesting — Average True Range
Average True Range (ATR) measures how much a market typically moves per candle, in price units, without regard to direction. It underpins volatility-based position sizing and breakout thresholds throughout technical trading — CandleTest lets you build entry and exit conditions directly from the ATR value, calibrated to your instrument’s real range rather than a guess.
How ATR works
True range for a candle is the largest of three measures: the current high minus low, the current high minus the previous close, and the previous close minus the current low — capturing gaps as well as normal range. ATR is a smoothed moving average of true range over a lookback window, using Wilder’s smoothing. Because it is an absolute price measure rather than a bounded oscillator, ATR rises in volatile stretches and falls in quiet ones, without predicting direction. CandleTest computes ATR with TradingView-parity math. It is most often used to size stops relative to current volatility or to define a breakout threshold, both expressible as no-code rules.
ATR settings
The smoothing window for true range. Shorter lengths make ATR react quickly to a sudden change in volatility; longer lengths produce a steadier, slower-moving volatility reading.
Example ATR strategies to backtest
Enter long when the close crosses above the EMA and ATR is above a threshold value tuned to the instrument — only taking trend entries once the market is showing real range rather than dead, low-volatility chop. Exit when the close crosses back below the EMA.
Enter long when the close crosses above the Bollinger Bands upper band and ATR is above a threshold value tuned to the instrument — confirming the breakout is backed by genuine volatility rather than a single quiet-market wick. Exit when the close crosses back below the upper band.
Every rule above is buildable in the no-code strategy builder — pick conditions, press run, and get win rate, drawdown and equity curve on real exchange data with fees and leverage modeled.
ATR FAQ
What is ATR used for in trading?
Most commonly for sizing stops and position size to current market volatility, so a stop is neither too tight for a volatile market nor too loose for a quiet one. It is a measurement tool rather than a directional signal on its own.
Does a higher ATR mean the market is going to move more?
It means the market has been moving more recently — it describes the past, not a guaranteed future. Whether elevated ATR tends to persist or mean-revert on a given pair is something a backtest over historical data can show.
What ATR length should I use?
It depends on the timeframe and how quickly you want the volatility reading to adapt to changing conditions — there is no single correct setting. Test a few lengths against your specific rule to see which produces more stable, useful thresholds.
Is CandleTest’s ATR the same as TradingView’s?
Yes — the true range and Wilder smoothing calculations follow TradingView conventions and are unit-tested for parity against known values.