OPEN-SOURCE SCRIPT
Güncellendi

ADR

1 003
**Overview**
This indicator displays the **Average Daily Range (ADR)** and **ADR Percentage** in a customizable table on your chart.

While the standard ATR (Average True Range) is a popular metric for volatility, it accounts for price gaps (e.g., overnight moves). **ADR**, on the other hand, strictly measures the average distance between the **High** and **Low** of price bars, completely ignoring gaps.

**Why use ADR instead of ATR?**

* **Day Trading:** For intraday traders (Forex, Crypto, Futures), ADR is often preferred because it calculates the "tradable" range of the day. It answers the question: *"On average, how much does this asset move from High to Low?"*
* **Target Setting:** ADR is excellent for projecting daily highs and lows. If price has already moved 100% of its ADR, the statistical probability of further extension decreases.
* **Pure Volatility:** It filters out the noise of overnight gaps to show pure intraday volatility.

**Calculation Logic**

* **ADR:** Calculated using a Simple Moving Average (SMA) of the `High - Low` range over the specified length.
* Formula: `SMA(High - Low, Length)`


* **ADR%:** Shows the ADR relative to the current price.
* Formula: `(ADR / Current Close) * 100`



**Features**

* **Clean Dashboard:** A minimalist table displays the ADR value and the ADR %.
* **Customizable:** You can change the calculation length (default is 14) and move the table to any corner of the chart (Top/Bottom, Left/Right) to fit your workspace.

**Settings**

* **ADR Length:** The lookback period for the average (Default: 14).
* **Display Position:** Choose where the table appears on your screen.
Sürüm Notları
Update the syntax to version 6
Sürüm Notları
Version 2.0 — ADR% calculation corrected

1. ADR% normalization order (changes displayed values)

Old: SMA(High - Low, N) / close * 100
New: 100 * (SMA(High / Low, N) - 1)

The old formula averaged absolute ranges first, then divided once by
the current close. That understates ADR% on stocks that trended up
across the lookback window and overstates it on stocks that trended
down.

Example — a stock moving 200 to 300 over 20 days with a consistent 4%
daily range: old formula returns 3.33% (average range of ~10 against a
close of 300), new formula returns 4.00%.

The new form converts each bar to a percentage before averaging, so the
reading no longer depends on price drift or on where the current close
sits. This matches the definition used by Qullamaggie and by most
public ADR% screeners, so thresholds quoted from those sources (5%, 7%)
now line up with what this script displays.

An optional (High - Low) / Close method is available in settings for
anyone who prefers that denominator.

2. Default length changed from 14 to 20

20 days is the convention in momentum screening. 14 is the Wilder/ATR
default and was inherited by habit rather than by intent.

3. Daily data on intraday charts

The script now pulls daily bars via request.security when applied to an
intraday chart, so "ADR" always means average DAILY range rather than
the average range of whatever timeframe the chart happens to be on.
Uses lookahead_off, so historical bars do not repaint. Can be turned
off in settings.

4. Table object lifecycle

table.new() moved to global scope and declared with var. Previously the
table object was rebuilt on every realtime tick instead of only its
cells being rewritten.

5. Absolute ADR formatting

Now formatted with format.mintick, so the value respects the
instrument's tick size instead of a fixed two decimals.

Note on ADR vs ATR: both the previous and current versions use High - Low,
not True Range. Gaps are excluded by design — ADR measures intraday
tradable range, which is the assumption behind ADR-based stop distance and
position sizing.

Existing users: readings will differ from v1, most visibly on names that
have trended hard over the last 20 sessions. This is the correction, not a
regression.
Sürüm Notları
fixed wording

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.