Blog / Strategy
Strategy

Range Percentile Reversion

Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.

What Is This Strategy?

Range Percentile Reversion is a counter-trend, mean-reversion strategy that trades the edges of a horizontal price range using a percentile position calculation paired with a rejection-wick candlestick filter. Unlike most range tools, it relies on no oscillator and no moving average. Instead, the only "indicator" is the raw geometry of the last several bars treated as a support-and-resistance band, plus the Average True Range (ATR) — a standard volatility measure — used purely to size the stop-loss.

The core idea is simple to picture. For every freshly closed candle, the strategy measures how high or low that candle's closing price sits inside the recent high-low band. A close pinned near the top of the band is "overbought within the range," while a close pinned near the bottom is "oversold within the range." Being at the edge alone is not a signal, however — ranges are frequently broken. So the strategy adds a confirmation requirement: a same-bar rejection wick that shows the edge was probed and then refused by the market. Only then does it fade the move back toward the middle of the range.

As a learning tool, Range Percentile Reversion is well suited to traders who want to study how mean-reversion logic behaves in rotational, sideways markets. It demonstrates how a strategy can quantify "stretched" price without a traditional indicator, how candlestick rejection can act as a trigger, and how volatility-based stops are constructed. It is designed for rotational conditions and is best treated as a study of range mechanics rather than a profit opportunity.

How It Works

The strategy evaluates one decision per newly closed bar and holds a maximum of one position at a time. Here is the logic in plain English:

range percentile reversion MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
Lots 0.10 0.01 1.00 Fixed trade size in lots for each position. Keep this small while learning.
RangeLookback 20 10 60 Number of recent closed bars used to build the high-low support/resistance band.
ExtremePct 0.85 0.70 0.95 Percentile threshold that defines a range edge. 0.85 means a close in the top 15% (or bottom 15%) qualifies as an extreme.
WickRatio 0.40 0.20 0.70 Minimum rejection-wick size as a fraction of the candle's full range. Higher values demand a more pronounced rejection.
AtrPeriod 14 7 30 Lookback length for the Average True Range, the volatility measure used to pad the stop-loss.
AtrStopMult 0.50 0.20 1.50 Multiplier applied to ATR to extend the stop beyond the band extreme, giving the trade breathing room.
range percentile reversion MT5 EA — MQL5 source code

Recommended Chart Settings

Range Percentile Reversion was built with EUR/USD or AUD/USD on the M15 or M30 timeframe in mind, because these pairs and timeframes tend to spend meaningful time in rotational, range-bound sessions where mean-reversion logic is most relevant. That said, the strategy is symbol- and timeframe-agnostic — it runs on whatever instrument and period you attach it to. Results will vary considerably across different market conditions, and a setting that looks balanced on one pair may behave very differently on another. Always study its behavior on your chosen market before drawing any conclusions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Like every approach, Range Percentile Reversion has clear strengths and equally clear limitations worth understanding.

Strengths. The logic is transparent and easy to reason about — there is no opaque indicator stack, just range geometry and a candlestick filter. The rejection-wick requirement helps avoid blindly fading every touch of an edge, and the ATR-padded stop adapts to current volatility rather than using a fixed distance. Targeting the midline gives the strategy a defined, mechanical exit instead of an open-ended hope.

Known limitations. This is a counter-trend method, which means its natural weakness is a trending or breakout market. When price genuinely breaks out of a range, the strategy will keep trying to fade the move, and a rejection wick can appear right before a strong continuation. In those conditions it may underperform or take a series of losing trades. The range band is also backward-looking — it is built from past bars, so a fresh expansion in volatility can place stops in awkward locations. Because the take-profit is fixed at the midline, the reward on any single trade is bounded, and a few stops beyond the band extreme can outweigh several midline targets if the win rate slips.

Treat this EA as a way to learn how range mechanics, percentile positioning, and candlestick rejection interact — not as a turnkey solution. Forward-test it thoroughly and observe how it copes when a quiet range finally breaks.

Risk Management Tips

Sound risk management matters far more than any single entry rule. Keep these general principles in mind as you study this strategy:

Risk Warning

Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.

Downloads

← Back to Blog