Indicators··6 min read

Average Daily Range Percentage Tracker with Alerts

0 references, link-verified · inline [n] markersEditor of record: Shane CantyStandards review editorial standard · audit log

This indicator monitors how the current day's price range (high minus low, expressed as a percentage) compares to its recent average. It flags periods when volatility expands or contracts sharply, helping traders identify when intraday movement deviates from the recent norm.

The tool suits intraday traders planning position sizing and risk management, range-bound traders seeking reversals at extremes, and anyone wishing to quickly spot volatility shifts without manual calculations.

//@version=6
indicator("Average Daily Range % Tracker with Alerts", shorttitle="ADR %", overlay=false)

// Inputs
length = input(20, title="MA Length", minval=1)
highMultiplier = input(1.5, title="High Alert Multiplier", minval=0.1)
lowMultiplier = input(0.5, title="Low Alert Multiplier", minval=0.1)

// Calculations
dailyRange = high - low
rangePercent = (dailyRange / close) * 100
avgRangePercent = ta.sma(rangePercent, length)

// Thresholds
highThreshold = avgRangePercent * highMultiplier
lowThreshold = avgRangePercent * lowMultiplier

// Alert conditions
alertHigh = rangePercent > highThreshold
alertLow = rangePercent < lowThreshold

// Plots
plot(rangePercent, title="Current Range %", color=color.blue, linewidth=2)
plot(avgRangePercent, title="Avg Range %", color=color.orange, linewidth=2)
plot(highThreshold, title="High Threshold", color=color.red, linestyle=hline.style_dashed)
plot(lowThreshold, title="Low Threshold", color=color.green, linestyle=hline.style_dashed)

// Background alerts
bgcolor(alertHigh ? color.new(color.red, 85) : alertLow ? color.new(color.green, 85) : na)

// Alert conditions for notifications
alertcondition(alertHigh, title="High Range Alert", message="Range above threshold")
alertcondition(alertLow, title="Low Range Alert", message="Range below threshold")

How the code works

The indicator calculates the intraday range each bar as high, low, then divides by the close price and multiplies by 100 to express it as a percentage [1]. This approach normalizes the range to the absolute price level: a one-point move in a $100 asset represents one percent, while the same one-point move in a $10 asset represents ten percent.

The ta.sma() function computes a simple moving average of these percentages over the user-defined length (default 20 bars) [1]. This moving average becomes the baseline expectation for daily range in recent trading.

The high and low thresholds are set as multiples of the average. By default, the high threshold sits at 1.5 times the average range (flagging unusually wide days), and the low threshold at 0.5 times the average (flagging unusually narrow days). Traders adjust these multipliers to suit their instruments and timeframes.

The alertcondition() function wires two alerts: one fires when the current range exceeds the high threshold, the other when it falls below the low threshold [1]. These can trigger notifications in TradingView if the trader sets up an alert on the indicator.

Reading it on a chart

When applied to a chart, the indicator displays two lines: the blue "Current Range %" line shows today's range on each bar, bouncing up and down as intraday volatility fluctuates. The orange "Avg Range %" line moves slowly, depicting the recent regime.

When the blue line spikes above the red dashed threshold, the background briefly flashes red and a notification fires (if alerts are enabled). This signals that today's move is significantly wider than the recent average, suggesting either breaking news, option expiry, or a shift toward higher volatility.

When the blue line drops below the green dashed threshold, the background turns green, indicating an unusually quiet day. Such contractions often precede expansion; traders tracking volatility cycles may watch for this as a setup signal.

The moving average itself reveals longer-term trends. A rising orange line indicates volatility is expanding on average; a falling line suggests markets are settling. In choppy or range-bound markets, the average stays relatively flat.

Limitations

This indicator measures historical range as a percentage of close price. On gap openings, it does not account for the gap itself: an asset that opens below the previous close and rallies to close near open may show a tight daily range even though overnight sentiment shifted sharply. The percentage denominator (close) also varies bar to bar, so comparing ranges across assets with different price levels requires mental adjustment.

The moving average lags by design. During a sudden shift in volatility regime (for example, a major announcement), the threshold may not catch the first few bars of the new regime as they exceed the old average. Increasing the MA length amplifies this lag but smooths noise; decreasing it makes the threshold more responsive but noisier.

The indicator does not predict market direction. A wide range may reflect either a strong directional move or two-sided confusion; a narrow range may precede either a breakout or more consolidation. Range expansion and contraction alone carry no edge without supporting confluence like support/resistance levels, order flow patterns, or macroeconomic events.

The alert thresholds are fixed multiples of the average. In assets that shift between calm and volatile regimes suddenly, a 1.5x multiplier that worked during low-volatility weeks may become oversensitive or undersensitive once volatility jumps. Adaptive thresholds (for instance, ATR-based [2] levels) would adjust automatically but would require a different indicator structure.

Finally, the current close price as the denominator can distort comparisons. The same two-point range would have higher or lower percentage readings depending on intraday price level, making historical comparisons less consistent than normalizing by a rolling reference like a 20-period average close.

Key definitions

Daily range: The difference between a bar's high and low price, measured in absolute price units.

Range percentage: Daily range divided by the close price and multiplied by 100, expressing the range as a proportion of the asset's price level.

Moving average: A smoothed version of a data series, computed as the arithmetic mean of the last N values. A 20-period simple moving average (SMA) averages the last 20 bars' range percentages.

Volatility regime: A period during which market price swings tend to cluster within a certain band; transitions between low and high volatility regimes are often sharp and unpredictable.

Threshold alert: A condition that triggers a notification when a metric crosses a predefined level; here, when current range exceeds 1.5x or falls below 0.5x the average.

Gap opening: A market opening at a price level significantly above or below the previous session's close, often driven by overnight news or pre-market sentiment.

Average True Range (ATR): A volatility indicator measuring average price movement per period, incorporating gaps and limit moves [2].

References

  1. TradingView, "Pine Script Documentation: v6 Reference Manual", TradingView (2025). Https://www.tradingview.com/pine-script-reference/v6/
  2. Wilder, J.W., "New Concepts in Technical Trading Systems", Trend Research (1978). [Classic reference for volatility measurement and Average True Range.]
  3. Wikipedia, "Technical Analysis", Wikipedia (2025). Https://en.wikipedia.org/wiki/Technical_analysis

Educational research on historical data only. Not investment advice, not a signal, and never a performance promise. Past results do not predict future performance. Every reference is link-verified before publication and every paper is re-audited weekly against the library's editorial standard.

Last reviewed by the PropLedger research pipeline: 2026-10-18. Educational research on historical data, not financial advice.

Educational research on historical data only. Not investment advice, not a signal, and never a performance promise. Past results do not predict future performance. Every reference is link-verified before publication and every paper is re-audited weekly against the library's editorial standard. Found an error? Email support@prop-ledger.org and the paper is corrected or withdrawn.