PulseHub
OPEN-SOURCE SCRIPT
Updated

Average Daily Range Projection

484
WHAT IT DOES

The Average Daily Range (ADR) Projection converts a historical average range into live price levels based on the range already realized during the current session.

Rather than anchoring fixed ADR bands to the session open or another single reference price, the indicator conditions each projection on the session's developing high and low. It answers a specific question: given the range already traded, where would price need to reach for this session to equal its recent average range?

Two independent sets let you compare separate baselines, such as the regular trading session versus the full futures session or a short lookback versus a longer one. This shows when price has satisfied one definition of its typical range while remaining below another.

CALCULATION

For each set, the indicator averages high minus low over up to the most recent N completed session windows. The ADR is fixed at the start of a new session; only the projected prices change as the current high and low develop. A partial session encountered when the script first loads is excluded.

Let ADR be the historical average, H the current session high, and L the current session low:

Pine Script®


Before the session has completed its ADR, these reduce to:

Pine Script®


These are conditional range-completion thresholds. A new high raises the lower projection, while a new low lowers the upper projection. As realized range expands, the additional movement required to equal ADR decreases. A reached threshold freezes and is labeled FILLED.

HOW TO READ IT

An open projection marks the price that would complete the configured average range in that direction, assuming the opposite session extreme does not change first. Its distance from price represents remaining range relative to the benchmark, not a prediction that price will reach it.

A FILLED label means the session range has reached or exceeded that set's trailing mean. If one set is filled while the other remains open, the session has satisfied one baseline but not the other.

Previous-session lines may be retained to review completed thresholds on the selected instrument and timeframe.

INPUTS

ADR Period sets the maximum number of completed sessions in each average. During initial data collection, the indicator starts after one complete session and uses the available sample until the selected period is populated.

Session Start, Session End, and Timezone define each measurement window; overnight windows are supported. Set 1 and Set 2 may use different windows, ADR periods, and styling. Show Previous Sessions retains completed levels, while Max Previous Sessions limits their number. Other controls manage labels, first-fill emphasis, and the optional information table.

The default Pacific-time windows are:

  • Set 1: 06:30 to 13:55, 14-session ADR
  • Set 2: 15:00 to 13:55, 14-session ADR


ALERTS

Four alert conditions cover upper and lower fills for both sets.

LIMITATIONS AND CALCULATION BEHAVIOR

ADR is a trailing sample mean, not a percentile, confidence interval, forecast, or estimate of reversal probability. Reaching it does not establish that a move is rare, exhausted, or likely to reverse. Outliers and volatility-regime changes can materially affect the average.

The script does not use future data or lookahead and does not repaint completed levels from future information. Active projections intentionally update as the session high or low changes, including during an open realtime bar. Completed-session lines show final or filled levels, not every level occupied intraday. Label Offset moves labels to the right for readability only; it does not reference future prices.

Calculations use extended-hours data so a full-session window remains intact on a regular-hours chart. Results depend on the data supplied by the symbol's feed, and an off-chart fill may already be marked when the next visible bar opens.

Designed for intraday charts with standard candles. Synthetic chart types can produce ranges and alerts based on synthetic prices rather than actual traded OHLC values.
Release Notes
Update:

- New: Fade Opposite Extreme on Fill (per set) — once one ADR target fills first, the opposite target line fades to 33% opacity, making it immediately clear which side of the range was hit first. Faded lines carry into previous sessions, so you can see at a glance which extreme filled on any prior day.
- New: Show Previous Session Labels toggle (per set) — keep previous sessions' projection lines on the chart while hiding just their labels, which could overlap current price action on regular-hours charts.

Both options are on by default and can be toggled independently for each ADR set in the indicator settings.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.