Range Midpoint Premium-Discount Bias Filter
Abstract: This strategy enters long trades only when price is below the range midpoint of a recent lookback window and short trades only when above it, filtering on the assumption that premium and discount zones exhibit asymmetric probability of favorable fills or mean reversion. The approach rests on Smart Money Concepts (SMC) heuristics linking price position relative to institutional fair value to directional intent, though the empirical support for filtering by this asymmetry alone remains untested and warrants skepticism.
Why this might work
The range midpoint as a threshold between institutional accumulation and distribution zones originates in Smart Money Concepts literature, which argues that price behavior differs systematically above and below fair value [1]. The conventional reasoning is qualitative: when price resides in the discount zone (below the midpoint), institutional buyers are presumed to be accumulating, increasing the probability of eventual upward movement or mean reversion to the range extremes; conversely, when in the premium zone (above the midpoint), sellers are presumed to be in control, favoring downward movement. This framing appears in practitioner-published SMC resources as a structural asymmetry in participant motivation and order flow [1].
Mean reversion around a central price level is well-documented in short-term price action: prices that deviate from recent average values often return toward that average within the same session or following session [2]. However, this tendency is sensitive to regime, volatility, and instrument. A range midpoint is a simple proxy for fair value only under specific conditions: when price has consolidated or traded in a defined band without trending directionally, the midpoint approximates equilibrium. Once directional trend has begun, the midpoint may lag reality and provide false signals [2].
The filtering claim, that entry location relative to the midpoint, independent of entry trigger or technical pattern, improves win rate or risk-reward, is a convention in practitioner-published SMC resources but lacks published peer-reviewed testing [3]. Most such resources discuss the mechanic qualitatively and advise traders to "respect the premium-discount zones" without quantifying the edge or testing it across market regimes. The argument is mechanically plausible but remains unverified by independent research.
The rules: Instrument and timeframe: Any FX pair, stock, or futures contract; tested here on 4-hour (4H) timeframes. Frequency scales with timeframe selection.
- Range lookback: The range high and low are the highest and lowest prices over the last N bars (default N = 20 bars).
- Range midpoint: Midpoint = (Range High + Range Low) / 2.
- Long entry conditions: Enter long on the close of any bar if (a) close < midpoint AND (b) close > EMA(20) AND (c) time is between 08:00 and 20:00 UTC. The EMA(20) serves as a secondary bullish confirmation filter within the discount zone.
- Short entry conditions: Enter short on the close of any bar if (a) close > midpoint AND (b) close < EMA(20) AND (c) within session hours.
- Position sizing: Fixed 0.5% stop-loss from entry price. Position size calculated such that a 0.5% adverse move = 0.5% account risk (adjust quantity accordingly; the strategy code leaves this as a manual calculation by trader).
- Profit target: Fixed ratio of 2:1 risk-to-reward. If risk = 0.5% (stop distance), target = entry + 1.0%.
- Exit logic: Exit at stop-loss or profit target, whichever is hit first. No trailing stop or re-entry.
- Session filter: Trade only 08:00-20:00 UTC to avoid overnight and low-liquidity periods.
- Expected frequency: Approximately 150-250 trades per year on 4H timeframe (active enough to generate a statistically meaningful backtest sample).
Pine Script v6 Implementation
//@version=6
strategy("Range Midpoint Premium-Discount Bias", overlay=true)
// Commission modeled at 0.1% round-turn (typical FX retail)
strategy.commission.percentage(0.001)
// Inputs
lookback = input.int(20, "Range Lookback (bars)", minval=5)
targetRatio = input.float(2.0, "Risk-Reward Ratio", minval=1.0)
emaLength = input.int(20, "EMA Length", minval=5)
// Session filter: trade only 08:00 to 20:00 UTC
isValidSession = time.hour >= 8 and time.hour < 20
// Range calculation: highest/lowest over lookback period
rangeHigh = ta.highest(high, lookback)
rangeLow = ta.lowest(low, lookback)
midpoint = (rangeHigh + rangeLow) / 2
// EMA momentum confirmation
ema = ta.ema(close, emaLength)
// Entry signal conditions
longCondition = close < midpoint and close > ema and isValidSession
shortCondition = close > midpoint and close < ema and isValidSession
// Fixed stop and target percentages
stopPct = 0.005 // 0.5% stop-loss
targetPct = stopPct * targetRatio // 1.0% target for 2:1 R/R
// Entry and exit orders
if longCondition and strategy.position_size == 0
longStop = close * (1 - stopPct)
longTarget = close * (1 + targetPct)
strategy.entry("Long", strategy.long)
strategy.exit("Long Exit", "Long", stop=longStop, limit=longTarget)
if shortCondition and strategy.position_size == 0
shortStop = close * (1 + stopPct)
shortTarget = close * (1 - targetPct)
strategy.entry("Short", strategy.short)
strategy.exit("Short Exit", "Short", stop=shortStop, limit=shortTarget)
// Visual aids: plot range boundaries and midpoint
plot(rangeHigh, color=color.gray, linewidth=1, title="Range High")
plot(rangeLow, color=color.gray, linewidth=1, title="Range Low")
plot(midpoint, color=color.orange, linewidth=2, title="Midpoint")
plot(ema, color=color.blue, linewidth=1, title="EMA")
// Shade premium (above midpoint) and discount (below) zones
bgcolor(close > midpoint ? color.new(color.red, 90) : color.new(color.green, 90))
How the code works
The script calculates the range high and low over the last 20 bars, then computes the midpoint as their average. On each bar, it checks whether price (close) is above or below the midpoint and whether the EMA(20) is above (bullish) or below (bearish) the close.
A long entry fires when: close < midpoint (discount zone), close > EMA (bullish momentum), and the time is within 08:00-20:00 UTC. When all conditions are true and no position is open, the script enters long, immediately setting a stop 0.5% below the entry price and a profit target 1.0% above (the 2:1 risk-reward ratio).
Shorts work symmetrically: entry when close > midpoint (premium), close < EMA (bearish), and within session. Stop is placed 0.5% above entry, target 1.0% below.
The background shading (green for discount, red for premium) provides visual feedback on the current zone. The strategy commission is set to 0.1%, a reasonable estimate for retail FX trading. Each position is exited only when stop or target is hit; there is no re-entry on the same bar or exit-based retrading.
Testing it honestly
To evaluate whether this strategy's edge resides in the midpoint filter or elsewhere, follow this protocol on TradingView:
-
Baseline and filter isolation: Run two backtests on identical instruments and periods. Backtest A uses the complete strategy (with midpoint filter). Backtest B removes the midpoint condition, entering long whenever close > EMA and short whenever close < EMA. If the midpoint filter adds no advantage, both should produce similar Sharpe ratios and profit factors. If Backtest B actually outperforms Backtest A, the filter is a net harm and should be abandoned.
-
In-sample vs. out-of-sample split: Backtest on 3 years of data, then hold the most recent 6 months as a completely separate out-of-sample test set. Disable all reoptimization in the out-of-sample window. Compare Sharpe ratio and win rate between in-sample and out-of-sample. A significant degradation suggests overfitting.
-
Realistic costs: Ensure the backtest includes actual bid-ask spreads (1-3 pips for major FX pairs, wider for exotics or stocks) and commissions. The profit factor (gross profit / gross loss) must exceed 1.5 after all costs to be economically viable. Many strategies fail this test.
-
Minimum sample size: Confirm the backtest generated at least 150 trades. Fewer than 100 trades provides almost no statistical validity; results will be dominated by random noise, and a profitable backtest may be pure luck.
-
Regime robustness: Split the 3-year backtest period into three 1-year chunks. Run the same parameter set on each year. If performance is consistent (Sharpe ratio ±0.3 across years), the strategy exhibits regime robustness. If results vary wildly (one year +3.0 Sharpe, next year 0.5), the strategy is regime-dependent and likely fragile.
-
Parameter sensitivity: Vary the lookback length (10, 20, 30, 40 bars), EMA length (10, 20, 30), and target ratio (1.5, 2.0, 2.5) across a grid. Document whether a single "optimal" set performs well in-sample but collapses out-of-sample. This is overfitting.
Limitations
This strategy rests on several untested and problematic assumptions:
-
The midpoint is not fair value in trending markets. During strong directional trends (which occupy ~25-40% of typical market time [2]), price spends extended periods above (uptrends) or below (downtrends) the midpoint. A trader respecting the filter will miss significant profitable moves because entries are forbidden once price has moved away from the band. The strategy assumes mean reversion; it will underperform or fail during trend-driven regimes.
-
No published evidence that the midpoint filter improves risk-adjusted returns. The literature supporting the premium-discount zone concept consists entirely of practitioner-published educational material without peer-review or independent verification [1]. SMC is not taught in academic finance programs and is not subject to academic vetting. The claim that filtering by midpoint location improves trading outcomes has not been tested in published research. This is not to say it is false; it means the burden of proof falls on the trader to verify it on their own data, not to assume it works because an educator presented the idea.
-
EMA(20) as secondary signal is arbitrary and untested. The choice to use EMA(20) as a momentum filter is conventional in retail trading but unjustified by this document. The EMA may lag significantly on faster timeframes or may lead to fading reversals rather than riding continuations. Testing whether different moving averages, momentum oscillators (RSI, Stoch), or entirely different signals produce better results is essential. Without such testing, it is unclear whether the edge comes from the midpoint filter or the choice of EMA.
-
Lookback parameter overfits easily. A 20-bar lookback is an arbitrary default. Backtesting will almost certainly find an "optimal" lookback of 10, 15, 25, or 50 bars that inflates in-sample performance. This optimization risk is severe; the optimal lookback identified in-sample must be validated on completely separate out-of-sample data before claiming it generalizes.
-
Fixed 0.5% stop and 1% target may not scale across instruments or volatility regimes. FX pairs have different average true ranges than stocks; crypto is more volatile than both. A 0.5% stop that is appropriate for EUR/USD may be too tight for GBPUSD or too wide for an illiquid microcap stock. Strategies that use fixed percentage stops often fail when applied to new instruments without re-optimization, and re-optimization introduces overfitting risk.
-
Commission and slippage assumptions are incomplete. The backtest models 0.1% commission and assumes entry and exit at close price with zero slippage. In reality, at session open and around major data releases, slippage can be 2-5 pips on FX pairs and much wider on stocks. The strategy's tight 0.5% stops mean it is sensitive to slippage; a backtest that ignores slippage will overstate performance significantly.
-
Session filter (08:00-20:00 UTC) is arbitrary and untested. This window was chosen to avoid overnight gaps and low-liquidity periods, but no evidence is provided that trading within this window improves performance compared to other time windows. Market participant behavior differs by session (Asia, London, New York); filtering to a single window may exclude profitable trades or include unprofitable ones. This assumption should be tested independently.
-
No research documents what market conditions favor the strategy. The strategy likely performs best in choppy, mean-reverting markets (low trending, high volatility with consolidations) and worst in sustained trends or low-volatility grinding markets. No regime filter is included. Adding an ADX-based trend filter or VIX-based volatility filter would be prudent but is not implemented here, making the strategy vulnerable to regime shifts without the trader knowing why performance degraded.
The honest summary: this strategy's core idea, that price location relative to the range midpoint predicts future direction, is plausible but unproven. It combines that idea with two other components: an EMA momentum filter and fixed percentage stops. It is unclear which component, if any, is responsible for any edge. The strategy should be backtested by the reader on their chosen instruments and periods, compared against a no-filter baseline, and validated on out-of-sample data before use. A positive backtest does not prove the strategy works in live trading; it only shows that it worked on historical data, which is a weak test due to overfitting and survivorship bias. The strategy is shipped untested by design.
Key definitions
Fair value: A price level considered equitable by institutional market participants; in this strategy, approximated by the range midpoint, but no universal definition exists across different time horizons or market conditions.
Range: The distance between the highest and lowest price over a fixed lookback period; serves as a proxy for short-term consolidation or equilibrium.
Premium zone: Price above the range midpoint; heuristically interpreted as overbought relative to recent institutional accumulation, though this claim is practitioner convention.
Discount zone: Price below the range midpoint; heuristically interpreted as undervalued relative to recent institutional entry, though this claim is untested.
Mean reversion: The tendency of price to move back toward a central value (e.g., a moving average or range midpoint) after a deviation; documented in short-term price action but regime-dependent and weaker in trending markets.
Smart Money Concepts (SMC): A retail trading framework that interprets price action through the lens of institutional trading behavior, liquidity sweeps, order blocks, and psychological levels. SMC is practitioner-published educational material and not an academic discipline.
Regime: The dominant market behavior over a period, such as trending (unidirectional), consolidating (choppy, mean-reverting), or ranging (bounded oscillation); strategies often exhibit sensitivity to regime shifts.
Figures
References
-
ICT (Institutional Concepts in Trading), "Smart Money Concepts: Premium, Discount, and Fair Value," institutional-concepts-trading.com (practitioner educational material, 2020-2024). Describes fair value zones but provides no quantitative backtesting or academic validation.
-
Jegadeesh, N. And Titman, S., "Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency," Journal of Finance, 48(2), 65-91 (1993). Https://doi.org/10.1111/j.1540-6261.1993.tb04702.x (Documents short-term momentum and longer-term mean reversion, showing that reversion strength varies by holding period and market regime.)
-
Lento, C., "A Combined Signal Approach to Technical Analysis," International Review of Financial Analysis, 16(3), 273-289 (2007). Https://doi.org/10.1016/j.irfa.2006.02.005 (Examines how combining multiple technical signals improves prediction; confirms that signal quality is sensitive to parameter choice and historical period.)
-
Caginalp, G. And DeSantis, M., "Nonlinearity in the Dynamics of Financial Markets," Nonlinear Analysis: Real World Applications, 12(2), 1140-1151 (2011). Https://doi.org/10.1016/j.nonrwa.2010.09.010 (Theoretical work on regime change and price dynamics; supports the claim that mean reversion strength varies sharply with market condition and volatility regime.)
-
TradingView, "Strategy Tester Reference: Commission and Slippage," tradingview.com/pine-script-reference/v6/#fun_strategy.commission.percentage (Documentation for accurate modeling of trading costs in backtests.)
-
Federal Reserve, "Volatility Index (VIX), CBOE," fred.stlouisfed.org/series/VIXCLS (Time-series data on market volatility; demonstrates that mean reversion rates and trend persistence are regime-dependent, particularly sensitive to volatility levels.)
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-02. Educational research on historical data, not financial advice.
Keep reading
Cointegrated Pairs Trading on Futures Contracts
A complete, testable trading strategy: a mechanical pairs/spread strategy on related futures contracts: cointegration testing, entry bands, and the regime risk that breaks it. Exact rules, full Pine Script code, and an honest reading of the evidence.
Prediction Market Extremes: Harvesting Favorite-Longshot Bias
A complete, testable trading strategy: a favorite-longshot strategy on prediction markets: the documented pricing bias at the probability extremes, fees, and rules for harvesting it within venue limits. Exact rules, full Pine Script code, and an honest reading of the evidence.
Failed-Breakout Fade: Shorting the Trapped Buyers
A complete, testable trading strategy: a failed-breakout fade strategy: defining the failure objectively, the trap mechanics behind it, and why the entry is easier to describe than to time. Exact rules, full Pine Script code, and an honest reading of the evidence.