All posts
Trading Education2025/12/30Updated: By Iven W.

Average True Range (ATR): Formula, Wilder Smoothing, and Data Controls

Learn the exact ATR formula, Wilder RMA smoothing recurrence, step-by-step Excel formulas, ATR Percentage normalization, and historical chart replay controls.

The Average True Range (ATR) formula calculates volatility in two steps: first, find each bar's True Range as TR = max(High - Low, |High - Previous Close|, |Low - Previous Close|); second, smooth those values over n periods (typically 14) using J. Welles Wilder's recursive average ATR_t = ((n - 1) × ATR_(t-1) + TR_t) / n.

Because Wilder smoothing is recursive, getting reproducible ATR readings across TradingView, Excel, and your broker requires controlling the initial seed, warm-up bar count, session hours, and corporate-action adjustments. To practice measuring bar-by-bar range expansion on historical charts without future candles visible, open ChartMini Market Replay or our 5-minute Day Trading Simulator, or explore zero-registration practice tools in our paper trading simulator without login guide.

This reference owns the ATR formula, Wilder RMA math, Excel calculation, and data-control layer. For stop-loss multipliers, position-sizing workflows, and chandelier trailing exits, use our companion ATR Indicator Guide.

Educational note: ATR measures historical range magnitude in raw price units. It does not predict trend direction or guarantee future stop survival.

Key takeaways

  • True Range captures both intrabar movement (High - Low) and overnight or inter-bar gaps against the prior close.
  • Wilder's ATR uses a recursive smoothing weight of 1 / n on the newest True Range and (n - 1) / n on the prior ATR value (labeled RMA or SMMA on TradingView).
  • Early ATR bars depend on the initial seed and preloaded chart history; always allow a shared warm-up window when reconciling two platforms.
  • Raw ATR carries the asset's quote unit (dollars, pips, or points) and cannot compare differently priced tickers without normalization.
  • ATR Percentage (ATRP = (ATR / Close) × 100) normalizes volatility relative to price.
  • An ATR(14) on a 5-minute chart measures fourteen 5-minute bars (70 minutes), not 14 trading days.
  • Regular-hours vs. extended-hours data, timezone cutoffs, stock splits, and futures roll gaps directly alter the previous-close term in True Range.

Which ATR guide owns which question?

QuestionCanonical Owner
What is the exact True Range and Wilder ATR formula?This formula and data-control guide
How do you calculate Wilder ATR step by step in Excel?This formula and data-control guide
Why do two charting platforms display different ATR numbers?This formula and data-control guide
How do you normalize ATR across differently priced stocks or pairs?This formula and data-control guide
How do you test 1.5x, 2.0x, or 3.0x ATR stop-loss placement?ATR Indicator Guide
How do you size positions from an ATR stop distance?ATR Indicator Guide and Risk Management & Position Sizing Guide

1. The True Range (TR) formula

For bar t, define three price inputs from the same historical series:

  • H_t = current bar high
  • L_t = current bar low
  • C_(t-1) = previous completed bar close

True Range is the greatest of three nonnegative distances:

TR_t = max(
  H_t - L_t,
  abs(H_t - C_(t-1)),
  abs(L_t - C_(t-1))
)

Taking absolute values ensures that a gap down below the prior close increases True Range just like a gap up above the prior close.

Worked True Range numerical examples

| Scenario | Previous Close (C_(t-1)) | Current High (H_t) | Current Low (L_t) | Intrabar (H_t - L_t) | Upper Gap (|H_t - C_(t-1)|) | Lower Gap (|L_t - C_(t-1)|) | Resulting True Range (TR_t) | |---|---:|---:|---:|---:|---:|---:|---:| | Normal inside/trending bar | 100.00 | 104.00 | 98.00 | 6.00 | 4.00 | 2.00 | 6.00 | | Bullish overnight gap up | 100.00 | 108.00 | 105.00 | 3.00 | 8.00 | 5.00 | 8.00 | | Bearish overnight gap down | 100.00 | 95.00 | 92.00 | 3.00 | 5.00 | 8.00 | 8.00 |

Look at rows 2 and 3: if you measured volatility using only High - Low (3.00 points), you would miss more than half of the true 8.00-point price displacement caused by the overnight gap.

Why the previous close is a critical data control

Even when two charts show the exact same current high and low, True Range will diverge if their previous-close source differs:

  • Regular trading hours (16:00 ET close) versus extended after-hours close (20:00 ET).
  • Official exchange settlement price versus last traded tick on futures contracts.
  • Split-adjusted and dividend-adjusted equity history versus unadjusted trade prices.
  • Dated individual futures contract versus a back-adjusted continuous symbol.
  • UTC daily candle cutoff versus New York 17:00 FX daily cutoff.

2. J. Welles Wilder's ATR formula (recursive RMA smoothing)

In his 1978 book New Concepts in Technical Trading Systems, J. Welles Wilder defined Average True Range using a 14-period lookback (n = 14), though traders use shorter or longer windows depending on their holding horizon.

Step A: Initial seed value (Bar n)

Wilder's standard implementation seeds the first ATR reading on bar n using the simple arithmetic mean of the first n True Range values:

Initial ATR_n = (TR_1 + TR_2 + ... + TR_n) / n

Step B: Recursive Wilder update (Bar n + 1 onward)

Every subsequent bar updates the prior ATR using a recursive weighted average:

ATR_t = ((n - 1) × ATR_(t-1) + TR_t) / n

For the standard 14-period setting (n = 14), this simplifies to:

ATR_t = (13 × ATR_(t-1) + TR_t) / 14

Or equivalently in alpha-weight form (α = 1 / n):

ATR_t = ATR_(t-1) + (TR_t - ATR_(t-1)) / n

Worked 5-period Wilder ATR vs. SMA calculation table

To see why Wilder's recursive ATR (RMA) does not equal a simple moving average (SMA) of True Range, trace this 5-period example (n = 5, where α = 1/5 = 0.20 and (n - 1)/n = 4/5 = 0.80):

Bar tTrue Range TR_tWilder ATR n = 5 Formula StepWilder ATR Value5-Bar Rolling SMA of TRDifference: Wilder vs. SMA
Bar 12.00Warm-up accumulation 1 of 5———
Bar 23.00Warm-up accumulation 2 of 5———
Bar 32.50Warm-up accumulation 3 of 5———
Bar 44.50Warm-up accumulation 4 of 5———
Bar 53.00Seed = (2.00 + 3.00 + 2.50 + 4.50 + 3.00) / 53.003.000.00, identical at seed
Bar 65.50((4 × 3.00) + 5.50) / 5 = 17.50 / 53.503.70-0.20
Bar 72.00((4 × 3.50) + 2.00) / 5 = 16.00 / 53.203.50-0.30
Bar 82.50((4 × 3.20) + 2.50) / 5 = 15.30 / 53.063.50-0.44

Notice that on Bar 8, the 5-bar SMA stays high at 3.50 until the old 4.50 spike drops out of the 5-bar window, whereas Wilder's recursive formula smoothly decays prior bars every step to 3.06. Note also that Wilder's smoothing with α = 1 / n reacts more gradually than a standard EMA of the same length where α = 2 / (n + 1): a 14-period Wilder RMA carries the same latest-bar weight of 1/14 ≈ 7.14% as a 27-period standard EMA where 2 / (27 + 1) = 7.14%.

3. How to calculate Average True Range (ATR) in Excel or Google Sheets

If you are building a spreadsheet backtest or verifying a chart indicator, place your OHLC data in columns A through E starting at Row 4 with Row 3 for headers and use these exact formulas for a 14-period Wilder ATR:

Spreadsheet RowColumn A–E OHLC InputsColumn F: True Range TR FormulaColumn G: 14-Period Wilder ATR(14) FormulaColumn H: ATR% Formula
Row 4, Bar 1A4: Date, B4: Open, C4: High, D4: Low, E4: Close=C4-D4, first bar has no prior closeLeave blank, warm-up bar 1 of 14Leave blank
Row 5, Bar 2A5:E5 OHLC values=MAX(C5-D5, ABS(C5-E4), ABS(D5-E4))Leave blank, warm-up bar 2 of 14Leave blank
Rows 6–16, Bars 3–13A6:E16 OHLC valuesDrag F5 formula down through F16Leave blank, warm-up bars 3 to 13Leave blank
Row 17, Bar 14 SeedA17:E17 OHLC values=MAX(C17-D17, ABS(C17-E16), ABS(D17-E16))=AVERAGE(F4:F17), initial 14-bar arithmetic seed=(G17/E17)*100
Row 18+, Bar 15+ WilderA18:E18 OHLC values=MAX(C18-D18, ABS(C18-E17), ABS(D18-E17))=((G17*13)+F18)/14, drag down for all later rows=(G18/E18)*100

Warm-up history tip for Excel vs. TradingView reconciliation

Because Wilder's formula in cell G18 feeds into G19, G20, and every cell below it, any difference in the initial seed G17 decays by 13/14 or 92.86% per bar. After 100 bars of warm-up history, the weight remaining on the initial seed is (13/14)^100 ≈ 0.06%, meaning your Excel sheet and TradingView will converge to identical numbers once both load at least 100 to 150 prior bars from the same OHLC feed.

4. Raw ATR price units vs. ATR Percentage (ATRP)

Raw ATR inherits the exact unit of the chart's vertical price axis:

  • U.S. equities: dollars per share, such as $3.40 per share.
  • Spot forex pairs: quote-currency units convert into pips, such as 0.0068 on EUR/USD for 68 pips, or 1.15 on USD/JPY for 115 pips.
  • Index futures: index points, such as 45.00 points on ES for $2,250 per contract at $50/point.

Because raw units scale with nominal price, a $20 stock moving $1.00 per day with Raw ATR = 1.00 is actually more volatile in percentage terms than a $200 stock moving $4.00 per day with Raw ATR = 4.00.

To compare volatility across different stocks or across multi-year price growth on the same ticker, normalize with ATR Percentage:

ATRP_t = (ATR_t / Close_t) × 100
InstrumentClosing Price Close_tRaw 14-Day ATR ATR_tNormalized ATRPVolatility Interpretation
Stock A$20.00$1.005.00%Higher relative daily range at 5% of share price
Stock B$200.00$4.002.00%Larger dollar move, but 60% lower relative volatility

Always specify which price denominator you used, such as Close_t, prior close, or a moving average, and remember that ATRP still does not measure futures contract multipliers, option gamma, or order-book liquidity.

5. Timeframe and chart interval scaling

An ATR(14) averages 14 bars of your active chart timeframe, not 14 calendar days:

Active Chart IntervalWhat ATR(14) Actually MeasuresTotal Lookback Span
5-minute chart, M5Average True Range of the last fourteen 5-minute bars70 minutes of trading
1-hour chart, H1Average True Range of the last fourteen 1-hour bars14 trading hours
Daily chart, D1Average True Range of the last fourteen daily bars~3 calendar weeks or 14 trading days
Weekly chart, W1Average True Range of the last fourteen weekly bars~14 calendar weeks

You cannot convert a Daily ATR(14) into an Hourly ATR(14) simply by dividing by the number of hours in a session, because intrabar overlaps and directional trends make multi-hour ranges scale sub-linearly. Furthermore, always read ATR on completed bars: an unclosed daily candle at 10:15 ET reflects only 45 minutes of high-low movement and will pull the live ATR reading artificially low until the session closes. For multi-interval rules, see our multiple timeframe analysis guide.

6. Why charting ATR readings differ: 10-point diagnostic checklist

When two charting programs display different ATR numbers on the same symbol, audit these 10 data controls before assuming a calculation bug:

Control LayerCommon Setting ACommon Setting BEffect on Calculated ATR
1. Smoothing methodWilder RMA with α = 1/nSimple SMA or Exponential EMAChanges responsiveness to recent volatility spikes
2. Warm-up bar count5,000+ preloaded historical barsOnly 100 visible chart bars loadedAlters recursive decay of the initial seed
3. Session templateRegular Trading Hours, 09:30–16:00 ETExtended Trading Hours, 04:00–20:00 ETChanges high, low, previous close, and overnight gap handling
4. Daily cutoff timezoneExchange local time, America/New_YorkUTC 00:00 daily boundarySplits 24-hour forex and crypto trades into different daily bars
5. Equity corporate actionsSplit- and dividend-adjusted OHLCUnadjusted historical trade pricesUnadjusted splits create artificial multi-dollar gap spikes
6. Futures roll methodAdditive back-adjusted continuous series 1!Unadjusted continuous or single dated contractContract switch gaps inflate True Range if not back-adjusted
7. Futures daily closeOfficial exchange settlement priceLast traded price at session closeShifts C_(t-1) gap calculation on the next session's open
8. Quote price sourceLast trade priceBid, Ask, or Midpoint price in OTC FXBid vs. midpoint changes high/low wicks during wide-spread news
9. Sunday FX bar policyMerged into Monday daily candlePlotted as a separate short Sunday daily barA 2-hour Sunday bar depresses 14-day average range
10. Current bar inclusionClosed bars onlyIncludes live, incomplete current barIncomplete bar depresses intraday or daily ATR early in the period

7. How ATR differs from ADR, Bollinger Bands, ADX, and Implied Volatility

Traders frequently confuse ATR with four other range or dispersion metrics. Each answers a distinct mathematical question:

IndicatorCore Formula InputCaptures Overnight Gaps?Directional or Unsigned?Primary Analytical Job
ATR, Average True Range`max(H-L,H-C_prev,L-C_prev
ADR, Average Daily RangeSimple average of Daily High - Daily Low over n daysNo, ignores prior day closeUnsigned, directionlessEstimating how far an intraday session has traveled vs. daily norm
Bollinger Band Width±k standard deviations of closing prices around an SMAIndirectly via close dispersionOverlay envelope around priceVisualizing price dispersion and mean-reversion extremes
ADX, Average Directional IndexSmoothed +DM and -DM normalized by True RangeYes, in denominatorUnsigned trend-strength score from 0 to 100Measuring whether price movement is trending or chopping
Implied Volatility, IVOption market premiums solved via pricing modelForward-looking market expectationUnsigned annualized %Pricing expected future move into option expiration

For deeper comparisons, see our Bollinger Bands trading guide and order types guide.

8. Step-by-step historical replay workflow for ATR volatility studies

When testing whether a volatility filter improves your setups, run a blind candle-by-candle replay in ChartMini Market Replay so future breakouts cannot bias your classification:

  1. Freeze your data controls up front: Record the symbol, timeframe, session template, ATR length of 14, Wilder RMA smoothing, and whether you are evaluating raw ATR or ATRP.
  2. Define an objective regime threshold from prior bars only: For example, classify a bar as compressed only when ATRP(14) closes below its trailing 50-bar median—never by eyeballing the middle of a completed historical chart.
  3. Hide future bars and step forward one closed candle at a time: Record candidate compression or expansion states at the bar close before advancing the replay.
  4. Log confirmed, failed, and ambiguous cases: Note when an overnight split, futures contract roll, or missing bar distorts the reading, and test your entry and stop rules using our manual backtesting guide.

Frequently asked questions

What is the True Range formula used by ATR?

True Range for bar t is the maximum of three nonnegative distances: current high minus current low, the absolute value of current high minus the previous close, and the absolute value of current low minus the previous close. All three inputs must come from the same session and adjustment series.

How is Wilder ATR initialized and updated?

J. Welles Wilder's standard implementation seeds the first n-period ATR with the simple arithmetic mean of the first n True Range values. Every subsequent bar updates recursively: Prior ATR multiplied by (n - 1), plus Current True Range, divided by n. Because it is recursive, platforms need a shared warm-up history to match.

How do you calculate Average True Range (ATR) in Excel?

With High in column C, Low in column D, and Close in column E starting at row 4, calculate True Range in F5 with =MAX(C5-D5, ABS(C5-E4), ABS(D5-E4)). Seed the first 14-period ATR in G17 with =AVERAGE(F4:F17), then drag down Wilder's smoothing formula in G18: =((G17*13)+F18)/14.

Why can two platforms show different ATR values?

Platforms can differ in smoothing mode (Wilder RMA vs. SMA or EMA), initial seed bar, loaded historical warm-up length, regular vs. extended session hours, daily cutoff timezone, split or dividend adjustments, and continuous futures roll back-adjustment.

Can raw ATR compare volatility across different instruments?

No. Raw ATR is denominated in the asset's native price units (dollars per share, pips, or index points). To compare relative volatility across assets at different price levels, normalize with ATR Percentage: (ATR / Close) × 100.

Is ATR the same as ADR, Bollinger Bands, ADX, or implied volatility?

No. ATR averages gap-adjusted True Range across any timeframe. ADR averages daily high-low bars without overnight gaps. Bollinger Bands plot standard deviation around a moving average. ADX measures directional trend strength, and implied volatility derives forward expectations from option prices.

Does rising or very low ATR predict the next price direction?

No. ATR is an unsigned volatility measure. Rising ATR shows expanding bar ranges during either rallies or selloffs, while low ATR shows range compression without telling you which way a future breakout will travel.

Sources and evidence boundaries