Average Day Range (ADR)
Summary
Average Day Range: the arithmetic mean of the last optInTimePeriod bar ranges, high minus low. It answers how far price travels within a bar, and is read as a volatility budget — a stop or a target much smaller than ADR is inside the noise the instrument produces on an ordinary bar, one much larger asks for a move that rarely happens.
Same family as ATR, and deliberately the narrower member: the range excludes the overnight gap, so on a gapping instrument ADR is systematically smaller than ATR. Having both is the point.
Formula
Range_t = High_t - Low_t; ADR_t = ( Σ Range over the last optInTimePeriod bars ) / optInTimePeriod
The average is a plain SMA, so there is no seeding convention and none of the cross-library divergence that comes with one.
Notes
- The mean of the ranges, not the difference of the means.
SMA(high) - SMA(low)is algebraically the same quantity and is what both TradingView pages spell, but it subtracts two price-magnitude averages to reach a range-magnitude answer and inherits the larger scale's rounding; TC2000'sAVG(H-L, x)and kand'sSMA(High-Low, period)spell the form implemented here. - The "day" is not a calendar day or a trading session. No TA-Lib function takes a timestamp or a session boundary, so the bars the caller passes are the days — pass daily bars for a daily range, hourly bars for an hourly one. This is the convention VWAP already ships under.
highbelowlowis not rejected. The library validates ranges and parameters, not price sanity, so a bar entered upside down contributes a negative range and the average simply comes out lower, possibly negative, with no error.- Not the width of a Donchian channel.
MAX(high, n) - MIN(low, n)is how far the window's extremes lie apart; ADR is the mean of the per-bar ranges, which is smaller whenever the window trends.DONCHIANships the two extremes that width is built from, not the width itself. - The request this function answers (
TA-Lib/ta-lib-python#575) named "Average Day Range" but the freqtrade code behind it computesMAX(close, 24) - MIN(close, 24), a channel width on the closes with no averaging and no high/low. That is a different series and already reachable, asTA_SUB(TA_MAX(close, 24), TA_MIN(close, 24)). - No percentage form is emitted. The two published ones disagree by more than 20% on ordinary data — Qullamaggie's
100 · (SMA(high/low, 20) - 1)averages ratios, TradingView's(SMA(high, 14) - SMA(low, 14)) / close · 100takes a ratio of averages — so picking one silently would ship a second indicator under this one's name.
Inputs
inHigh— High price of each barinLow— Low price of each bar
Outputs
outReal— Average bar range over the window, in price units
Parameters
| Parameter | Type | Default | Accepted values | Description |
|---|---|---|---|---|
optInTimePeriod | integer | 14 | 1–100000 | Number of bar ranges averaged. Published conventions differ and none is authoritative: TradingView's ADR indicator page works its example over 7 bars, TC2000's over 10, and the Qullamaggie screener community reads "ADR" as 20. The value shipped here is ATR's, so the two volatility measures are comparable out of the box. |
Properties
Numerical Stability: Start-Independent
| ☐ Overlap Input |
| ✅ Independent Y-Axis i |
| ☐ Candlestick |
| ☐ Can Output NaN or ±Inf |
| ☐ Identity at Period 1 |
Implementation
TA-Lib Definition: adr.c · adr.yaml
| Native | File |
|---|---|
| C | ta_ADR.c |
| Rust | adr.rs |
| Java | Core_ADR.java |
TA-Lib is also available for Python, R and more using a wrapper.
Aliases
Average Daily Range
See Also
ATR · DONCHIAN · NATR · QSTICK · TRANGE
References
- TC2000 PCF help, Average Daily Range (ADR) —
AVG(Hz-Lz, x), the mean-of-ranges form, with worked examples over 10 bars. - TradingView, Average Daily Range (ADR) indicator — the difference-of-averages form, over a user-supplied Length and Timeframe.
- TradingView, How are ADR% and ATR% calculated? — the percentage form, and the statement that ADR "does not take gaps into account".
- kand
ohlcv/adr.rs(Rust) statesDaily Range = High - Low; ADR = SMA(Daily Range, period)and is the external implementation the regression goldens are captured from.