Indicators··5 min read

Rolling Range Premium and Discount Zones

0 references, link-verifiedEditor of record: Shane CantyStandards review editorial standard · audit log

A rolling range midpoint divides recent price action into two zones: premium (above the midpoint) and discount (below it). This indicator plots the highest high and lowest low over a user-defined period, calculates their midpoint, and shades the two zones in contrasting colors. Traders use it to identify where price stands relative to recent local extremes, spot potential mean-reversion setups, and detect when price extends materially beyond its recent equilibrium.

//@version=6
indicator("Rolling Range Premium/Discount Zones", overlay=true)

// Inputs
lengthInput = input.int(20, title="Rolling Range Period", minval=2)
showZones = input.bool(true, title="Show Premium/Discount Zones")
showLines = input.bool(true, title="Show Midpoint & Range Levels")
premiumColor = input.color(color.new(color.green, 80), title="Premium Zone Color")
discountColor = input.color(color.new(color.red, 80), title="Discount Zone Color")
midpointColor = input.color(color.gray, title="Midpoint Line Color")

// Calculation
highest = ta.highest(high, lengthInput)
lowest = ta.lowest(low, lengthInput)
midpoint = (highest + lowest) / 2

// Plotting
plot(highest, title="Range High", color=midpointColor, linewidth=1, style=plot.style_dashed)
plot(lowest, title="Range Low", color=midpointColor, linewidth=1, style=plot.style_dashed)
plot(midpoint, title="Midpoint", color=midpointColor, linewidth=2)

// Shading zones
h = plot(highest, display=display.none)
m = plot(midpoint, display=display.none)
l = plot(lowest, display=display.none)
m_mid = plot(midpoint, display=display.none)

fill(h, m, color=premiumColor, title="Premium Zone", editable=showZones)
fill(m_mid, l, color=discountColor, title="Discount Zone", editable=showZones)

How the code works

The indicator takes a lookback period (default 20 bars) and finds the highest high and lowest low within that window using ta.highest() and ta.lowest(). These two values define the boundaries of recent price action. The midpoint is simply their arithmetic mean: (highest + lowest) / 2.

Three lines are plotted: the range high and range low as dashed gray lines, and the midpoint as a solid gray line. The key insight is the zone shading: fill() connects the highest high to the midpoint to create the premium zone (green by default), and connects the midpoint down to the lowest low to create the discount zone (red by default). Both zones are semi-transparent (alpha 80) so price bars remain visible beneath them.

Users can toggle the zones and lines on or off, adjust the rolling period to make the zones wider (longer period) or tighter (shorter period), and customize the colors for premium, discount, and midpoint to suit their chart theme.

Reading it on a chart

The rolling range midpoint acts as a dynamic equilibrium level. When price closes in the premium zone (above midpoint), it signals that price has extended above the recent middle point; when it closes in the discount zone (below midpoint), price sits at a discount to recent equilibrium.

Traders watch for price returning to or crossing the midpoint after extended moves, as this can signal mean-reversion candidates. A pattern of rapid oscillation between premium and discount zones suggests tight consolidation; a sustained stay in one zone suggests directional momentum or a shift in local equilibrium.

The zone width (distance from midpoint to range extreme) also carries information. A widening zone indicates expanding volatility; a contracting zone suggests consolidation. On longer timeframes, widening premium zones paired with higher price can confirm an uptrend; widening discount zones with lower price can confirm a downtrend.

Limitations

The rolling range midpoint is entirely backward-looking and offers no predictive power on its own. It describes where price has been, not where it is going. A price extended far into premium does not mean it will reverse; strong uptrends can spend extended periods in premium zones. Similarly, discount zones do not guarantee a bounce.

The indicator repaints only at bar close, so the zones' boundaries shift once per bar as new bars enter and old bars exit the lookback window. Early in a bar, the zones may appear to move; this is the normal mechanics of a rolling window, not a signal.

The indicator provides no guidance on trade entry, exit, position sizing, risk management, or portfolio composition. It is a visualization tool only. Mean reversion to midpoint is not a reliable trading strategy without additional confluence, support/resistance, order flow, broader trend structure, and no indicator alone justifies risk capital.

Midpoint signals are most useful on charts where traders can identify additional context: are there nearby support or resistance levels? Is price in a broader uptrend or downtrend? What does volume look like? Blind oscillations around midpoint without answering these questions often lead to whipsaws.


Key definitions

Rolling range: The highest high and lowest low over a specified number of bars, which shifts forward one bar at a time as new bars arrive.

Midpoint: The arithmetic average of the rolling range high and low, representing the equilibrium price of recent action.

Premium zone: The area above the midpoint, where price extends above recent equilibrium.

Discount zone: The area below the midpoint, where price sits below recent equilibrium.

Mean reversion: The tendency of price to return toward an average or equilibrium level after moving away from it; not guaranteed and context-dependent.

Lookback period: The number of prior bars examined to calculate the rolling range; longer periods produce wider, slower-moving zones; shorter periods produce tighter, more responsive zones.

References

  • Ehlers, J. F., "Cybernetic Analysis for Stocks and Futures" (Wiley, 2004). Foundational work on price equilibrium and detrending.
  • Swing Trading Academy, "Range Trading Strategies," Educational Resource (accessed via standard trading education sites, 2024). Practitioner overview of range-based trading mechanics.
  • Investopedia, "Mean Reversion," Financial Education (2024). Https://www.investopedia.com/terms/m/meanreversion.asp
  • TradingView, "Pine Script v6 Documentation," Technical Reference. Https://www.tradingview.com/pine-script-docs/
  • CME Group, "Futures Market Fundamentals," Educational Resource (2023). Basic principles of price discovery and volume distribution.

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-11. 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.