TradingView volatility comparisons

ATR vs ADR: overnight gaps and daily range

ATR averages true range, which includes the previous close when it lies outside the current high-low range. ADR averages daily high minus low. Both are price distances, but TradingView also uses different default averaging methods: RMA for ATR and SMA for ADR. Match the daily data, length, smoothing, and confirmation time to isolate the effect of overnight gaps. ATR and ADR can differ even without gaps when their smoothing differs.

See the decision guide

The difference starts with one completed day

Let H and L be the daily high and low, and Cprev the previous daily close. Daily range is H − L. True range is max(H − L, abs(H − Cprev), abs(L − Cprev)). Equivalently, it is max(H, Cprev) − min(L, Cprev). The open helps describe the gap, but it is not an additional term in either formula.

  • All prices are hypothetical dollars. The second row has a $5 opening gap, but the excess of true range over daily range is $4. Adding the opening gap to H − L would double count the portion already inside the day's range.
  • True range is at least daily range for valid OHLC data. It is strictly larger only when the previous close is outside [L, H]. ADR does not add a separate overnight component, although trading after a gap can widen the daily high-low range.
Hypothetical daily OHLCH − L|H − Cprev||L − Cprev|True range
Cprev 101; O 101, H 103, L 100, C 1023213
Cprev 101; O 106, H 108, L 105, C 1073747
Cprev 101; O 96, H 97, L 94, C 953477
Cprev 100; O 103, H 105, L 99, C 1046516

Hold the daily ranges fixed and change the gap

These two constructed four-day paths both start with a previous close of 100. Each has daily ranges 3, 3, 4, 2. The second path adds a gap on day 2; the following prices are shifted so that their daily ranges and lack of further gaps match the first path. Values are not market observations or a backtest.

  • At day 3 with length 3 and SMA for both inputs, the no-gap path gives SMA(TR) = ADR = (3 + 3 + 4) / 3 = 3.333333. The gap path gives SMA(TR) = (3 + 7 + 4) / 3 = 4.666667, while ADR remains 3.333333.
  • The matched-SMA difference is 4 / 3 = 1.333333. It is the mean of the daily excesses TR − (H − L), which are 0, 4, 0. It isolates the previous-close contribution because the averaging method and window are identical.
Path / dayOpenHighLowCloseDaily rangeTrue range
No gap / 11001029910133
No gap / 210110310010233
No gap / 310210610210544
No gap / 410510610410522
Gap / 11001029910133
Gap / 210610810510737
Gap / 310711110711044
Gap / 411011110911022

Why default ATR can fall below ADR without any gap

TradingView documents RMA as the default ATR smoothing. Its ADR calculation subtracts SMA(low, N) from SMA(high, N), equal to SMA(high − low, N) for the same complete observations. RMA updates as previous RMA × (N − 1) / N + current input / N. Unlike an SMA window, it retains a decaying contribution from older observations.

  • For the no-gap path, day 4 ATR is (2 × 10/3 + 2) / 3 = 26/9, while ADR is (3 + 4 + 2) / 3 = 3. ATR is smaller despite true range equaling daily range on every day.
  • For the gap path, day 4 ATR is (2 × 14/3 + 2) / 3 = 34/9. The same-SMA comparison still differs by 4/3. Subtracting ADR from default ATR mixes smoothing and gap effects, so it is not a pure gap estimate.
  • The stated RMA seed uses only these first three observations. A chart with earlier history can have a different ATR. Match the seed and preceding history when reproducing the table; do not compare only the last three visible candles.
Length 3No-gap pathGap path
Day 3: RMA(TR), seeded with days 1 to 33.3333334.666667
Day 4: RMA(TR), default ATR method2.8888893.777778
Day 4: SMA(TR), matched smoothing control3.0000004.333333
Day 4: SMA(H − L), ADR3.0000003.000000

Daily versus intraday, and price units versus percent

A 14-period ATR on a five-minute chart summarizes five-minute true ranges. It is not a 14-day ATR. Likewise, averaging fourteen five-minute high-low ranges does not produce ADR. Use daily source bars for a daily comparison, even when the values are displayed on an intraday chart.

  • Both raw outputs use the instrument's quoted price units. A stock reading of 3 means $3 if its quote currency is USD; a futures reading is a price distance, not a cash-risk amount. Contract value and position size are separate inputs.
  • For a stated positive close, 100 × range average / close expresses the distance as a percentage. TradingView documents this current-close denominator for ADR% and ATR%. Other community scripts may average daily percentages instead; those formulas need not agree.
  • A day means the data feed's daily session, which can cross midnight for some instruments. Keep exchange symbol, session, adjustments and feed identical. Split adjustments and futures-roll construction can affect apparent gaps.
  • Use standard price candles. Synthetic chart OHLC can change the ranges. Neither measure records the sequence of intraday trades, cumulative movement, spread, or available liquidity.

A complete Pine v6 comparison on confirmed daily bars

Paste this indicator into Pine Editor and run it on a standard 1D chart. It plots default-method ATR, SMA of true range, and ADR with one shared length and the same OHLC. During an unfinished daily candle, all three display the previous completed day's value; at the daily closing update, all three advance together. The script rejects other chart types and intervals so that its labels remain daily.

  • Warm-up: the averages remain unavailable until enough valid daily observations exist. ta.tr(true) uses high minus low when the previous close is unavailable on the initial bar. That initial fallback cannot measure a gap from a close that the dataset does not contain.
  • At length 1, ATR and SMA(TR) equal the selected completed day's true range; ADR equals its daily range. A flat day at the previous close has both ranges zero. A flat day at a different price can have zero daily range but positive true range.
  • Confirmation is deliberate: the open daily bar carries yesterday's result rather than today's partial range. On historical bars, each value belongs to that day's close. Reloading after a day closes shows its completed result; do not interpret that closing value as having been known at the day's open.
  • For daily values on an intraday chart, request the daily calculation itself and use a confirmed higher-timeframe policy. TradingView documents a one-daily-bar expression offset with lookahead_on to make the previous day's result available from the next day's start. An unoffset lookahead_on request leaks future daily values into historical intraday bars. A confirmed five-minute bar alone does not confirm the day.
Pine v6 syntax checked. This is a calculation display, not a strategy or an execution test. Series names in the Data Window identify the lines independently of color.pine
//@version=6
indicator("ATR vs ADR: confirmed daily comparison", overlay = false, format = format.price)
int length = input.int(14, "Completed daily observations", minval = 1)
if not chart.is_standard or not timeframe.isdaily or timeframe.multiplier != 1
    runtime.error("Use a standard 1D chart.")

float dailyRange = high - low
float trueRange = ta.tr(true)
float atrRma = ta.atr(length)
float trSma = ta.sma(trueRange, length)
float adrSma = ta.sma(dailyRange, length)

// Calculate every bar; apply one confirmation policy to every displayed series.
float atrShown = barstate.isconfirmed ? atrRma : atrRma[1]
float trShown = barstate.isconfirmed ? trSma : trSma[1]
float adrShown = barstate.isconfirmed ? adrSma : adrSma[1]
plot(atrShown, "Daily ATR (RMA)", color = color.blue, linewidth = 2)
plot(trShown, "Daily true range (SMA)", color = color.orange, linewidth = 2)
plot(adrShown, "Daily range (SMA / ADR)", color = color.purple, linewidth = 2)
plot(trShown - adrShown, "Matched SMA gap contribution", display = display.data_window)

Use the comparison to specify a rule, not a price ceiling

ADR describes the average high-low span of past daily bars. Daily ATR adds previous-close movement and applies its chosen smoothing. Choose the input that matches your proposed distance rule, then test that rule separately with costs and fill assumptions. Neither average predicts direction or limits how far today can move.

  • If today's developing range is 4 and a prior completed ADR is 3, the ratio is 133.33%. This describes range already observed; it does not establish a reversal probability or imply a negative remaining trading range.
  • A stop distance based on ATR can still be crossed by a gap. ADR excluding the separate overnight component does not make an overnight position safe. Historical range statistics cannot guarantee an executable stop price.
  • The Pine Script AI Coding Agent can draft a script from an explicit comparison rule. Provide daily source data, length, smoothing, session, warm-up and confirmation policy. Request its syntax-check tool explicitly, then compare generated values against the worked sample. Syntax validation does not establish the rule's financial behavior.
Where Pineify fits

Pine Script AI Coding Agent

Draft a daily range comparison with shared inputs and confirmation rules. Request a syntax check and inspect the calculations before using them in a strategy.

Draft a daily range comparison

Frequently asked questions

Educational comparison, not investment advice. Numerical examples use hypothetical prices and are not backtests. Range statistics do not predict direction, guarantee a fill, or establish profitability. Review generated code and test any trading rule independently.

Sources and verification

Published by Pineify. Pineify is an independent product and is not affiliated with TradingView. Sources support the technical explanations; examples do not establish trading performance.