Premium and Discount Zones from Rolling Midpoint
A trader needs to know whether current price sits in territory that is expensive (premium) or cheap (discount) relative to recent equilibrium. This indicator plots a rolling range midpoint, then extends upper and lower bands proportional to the range width, creating visual zones where price above the midpoint signals overextension and price below signals underextension. Mean-reversion traders, swing traders assessing entry/exit conditions, and mechanical systems developers use this framework to identify when price has moved far from its rolling center and may be due to snap back.
//@version=6
indicator("Premium and Discount Zones from Rolling Midpoint", overlay=true)
// Inputs
length = input(20, title="Rolling Range Length", minval=1)
zoneWidth = input(1.0, title="Zone Width Multiplier", minval=0.1, step=0.1)
showMidpoint = input(true, title="Show Midpoint")
showZones = input(true, title="Show Zones")
// Calculate rolling range
rhi = ta.highest(high, length)
rlo = ta.lowest(low, length)
mid = (rhi + rlo) / 2.0
halfRange = (rhi - rlo) / 2.0
// Calculate zones
premium = mid + (halfRange * zoneWidth)
discount = mid - (halfRange * zoneWidth)
// Plot midpoint
plot(showMidpoint ? mid : na, title="Midpoint", color=color.gray, linewidth=2, style=plot.style_dashed)
// Plot zones
pPlot = plot(showZones ? premium : na, title="Premium Zone", color=color.new(color.green, 50), linewidth=1)
dPlot = plot(showZones ? discount : na, title="Discount Zone", color=color.new(color.red, 50), linewidth=1)
mPlot = plot(showZones ? mid : na, display=display.none)
// Fill between zones and midpoint
fill(pPlot, mPlot, color=color.new(color.green, 90), title="Premium Fill")
fill(mPlot, dPlot, color=color.new(color.red, 90), title="Discount Fill")
How the code works
The script computes the highest high and lowest low over the past N bars (default 20), then calculates their midpoint, which represents the center of price action over that window. It measures half the range (the distance from midpoint to either extreme), then multiplies that half-range by a user-defined multiplier to set the width of the premium and discount zones.
Lines 11-14: The rolling range calculation uses ta.highest(high, length) and ta.lowest(low, length) to find the period's extremes without lookahead. The midpoint is their average. Half-range is the distance from center to edge.
Lines 17-18: The premium zone top is placed at midpoint plus (halfRange times zoneWidth multiplier). The discount zone bottom sits at midpoint minus the same offset. By default, zoneWidth = 1.0, so the zones extend exactly one half-range from the midpoint; a multiplier of 0.5 would bring them closer; 2.0 would push them further.
Lines 20-28: Three plot objects are created: the midpoint as a dashed gray line, the premium and discount boundaries, and a hidden midpoint plot used as a reference for fill areas. The fill() function colors the region between premium and midpoint in light green, and between midpoint and discount in light red. These shaded regions make the zones visually obvious without cluttering the chart with extra lines.
Reading it on a chart
A trader looks for price touching, entering, or exiting the colored zones. When price climbs into or above the green premium zone, the chart signals that the asset has moved significantly higher than its recent average position. When price sinks into or below the red discount zone, the chart signals the opposite: price is significantly lower than recent equilibrium.
The midpoint itself (gray dashed line) serves as the neutral reference. Price oscillating around it suggests a balanced market; price consolidating above the midpoint over multiple bars suggests buyers are maintaining altitude; price stuck in the discount zone over time suggests sellers maintain pressure.
Traders typically use this in two ways. First, as an entry signal: when price drops sharply into the discount zone, some buy on the assumption price will revert toward the midpoint. When price climbs into premium, some sell short. Second, as a confirmation filter: a signal from another indicator or pattern gains credibility if price is in an aligned zone (bearish signals carry more weight when price is already in premium; bullish signals when price is in discount).
The rolling range length and zone width multiplier are both tunable. Shorter lengths (10-15 bars) make the zones tighter and more responsive to recent price. Longer lengths (30-50 bars) make them wider and slower to shift, capturing longer-term equilibrium. Adjusting zone width lets traders dial in zone sensitivity independent of range width.
Limitations
This indicator relies entirely on historical price extremes and assumes the rolling midpoint is a meaningful equilibrium. In reality, there is no mechanical reason price must revert to this center; during strong trends, price may spend extended periods in premium or discount without snapping back. A trader following premium entries in a bull trend, for example, may enter repeatedly into further losses as the uptrend persists.
The indicator is also backward-looking. The rolling range midpoint adjusts once a new bar is complete, so the zones lag real-time price by at least one bar. On fast-moving assets or during gaps, entry or exit signals based on zone crossings may execute at unfavorable prices.
Zone width multiplier choice is arbitrary and subjective. A multiplier of 1.0 is not statistically optimal or derived from market microstructure; it is simply convention. No two traders need agree on the correct width, and changing it reshapes the entire signal landscape. This flexibility is useful for tuning to a specific asset or timeframe, but it also means the indicator is not a universal rule: users are responsible for fitting parameters to their own context.
The indicator does not account for volatility change. During a low-volatility period, the half-range is small and zones are narrow; during expansion, ranges widen and zones move outward. A trader accustomed to tight zones during calm markets may find the zones useless during spikes if they do not adjust the multiplier dynamically. Many traders prefer indicators that normalize for volatility (such as Bollinger Bands or ATR-based channels) for this reason.
Key definitions
Rolling range: the high and low prices over a fixed number of bars, e.g. the highest high and lowest low of the past 20 bars.
Midpoint: the arithmetic mean of the rolling range high and low; (high + low) / 2.
Premium zone: the band above the midpoint where price is considered elevated relative to the rolling equilibrium, typically used as a bearish entry signal or risk target.
Discount zone: the band below the midpoint where price is considered depressed relative to the rolling equilibrium, typically used as a bullish entry signal or risk target.
Mean reversion: the trading assumption that price that deviates sharply from an equilibrium level (midpoint, moving average, or other reference) will tend to return toward that level.
Half-range: the distance from the midpoint to either the rolling high or rolling low; equal to (high, low) / 2.
References
- Investopedia, "Moving Average: What It Is and How to Calculate It", Investopedia (n.d.). Foundational reference on rolling window calculations.
- CME Group, "E-mini S&P 500 Futures Contract Specifications", CME Group (n.d.). Primary source for contract specifications and market microstructure.
- Wikipedia, "Mean reversion", Wikipedia (n.d.). Explanation of mean-reversion trading theory.
- Investopedia, "Bollinger Bands: Overview and Common Uses", Investopedia (n.d.). Secondary source on volatility-normalized bands as an alternative framework.
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-11-22. Educational research on historical data, not financial advice.
Keep reading
Swing Structure: BOS & CHoCH
Free open-source Pine Script indicator: swing high/low structure marker (BOS and CHoCH labels). Full code and a plain-English walkthrough.
Spread Tracker
Free open-source Pine Script indicator: spread tracker between two related futures contracts. Full code and a plain-English walkthrough.
New High/New Low Breadth Proxy
Free open-source Pine Script indicator: new high/new low breadth proxy for a symbol basket. Full code and a plain-English walkthrough.