Blog / Strategy
Strategy

Modal Price 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?

Modal Price Reversion is a volatility-normalised mean-reversion strategy built around one of the least-used but most intuitive statistics in trading: the mode. In statistics, the mode is simply the value that occurs most often in a data set. Applied to price, the modal price is the single level the market has visited and lingered at more than any other during a recent window — the price traders have most actively accepted. This strategy uses a volatility-scaled histogram of closing prices to find that level and then fades stretched moves back toward it.

Most "fair value" tools — the moving average (mean), the median, or VWAP (volume-weighted average price) — get dragged around by outliers and drift with every new bar. A single spike bar can pull a mean noticeably away from where the market has actually been trading. The mode ignores that. Because it counts how often price has been at each level rather than averaging the levels together, it points to a genuine acceptance zone — a "point of control" that behaves like a magnet. When price is stretched a long way from that zone and begins to snap back, the odds historically favour a return to the crowded level.

As a learning tool, Modal Price Reversion is well suited to traders who want to understand range-based mean reversion and how to build objective, self-scaling entry filters. It is deliberately designed for balanced, range-prone conditions on liquid instruments, and it includes an explicit "regime gate" that keeps it out of trends — the exact environment where fading is most dangerous. It is not a trend-following system, and it is not intended to trade continuously.

How It Works

The Expert Advisor (EA) evaluates its logic once per completed bar. On each freshly closed candle, the strategy signals as follows:

When all conditions align:

Exit logic is symmetric and fully bracketed on entry:

modal price mean reversion
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
Lookback 60 20 150 Number of closed bars used to build the price histogram (the acceptance window).
BinAtrFraction 0.25 0.10 0.60 Histogram bin width as a fraction of ATR. Finer bins produce a sharper, more precise mode.
StretchAtr 1.8 1.0 3.5 Minimum distance from the modal price, in ATRs, before a fade is allowed.
AtrPeriod 14 7 30 ATR period used for volatility scaling of every distance in the system.
MinClusterFraction 0.15 0.05 0.40 Fraction of the window's closes the modal bin must hold to count as a dense, ranging acceptance zone (the regime gate).
StopAtr 1.5 0.8 3.0 Stop-loss distance beyond the entry, as a multiple of ATR.
MaxSpreadPoints 25 1 200 Skip the trade if the current spread (in points) is wider than this.
Lots 0.10 0.01 1.00 Trade volume in lots.
Magic 4127 0 9,999,999 Unique identifier so the EA manages only its own positions.
modal price mean reversion — MQL5 source code

Recommended Chart Settings

Modal Price Reversion was designed for balanced, range-prone conditions on liquid FX pairs or metals — for example EUR/USD, USD/JPY, or XAU/USD (gold). Because every threshold is expressed in ATR rather than fixed points, the strategy is single-timeframe and runs on whatever timeframe you apply it to. Intraday charts such as M15 to H1 are a natural starting point for studying range behaviour, but you should treat the timeframe as a variable to test rather than a fixed rule.

Keep in mind that results will vary considerably across different market conditions. A pair that ranges cleanly in one month may trend strongly the next, and the density gate will (by design) keep the strategy inactive during those trending stretches. Always study behaviour across a range of symbols and periods before drawing conclusions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths. The mode is a robust equilibrium anchor: because it counts visited levels rather than averaging them, it largely ignores spikes and outliers that distort a mean or VWAP. The density gate is a genuine attempt to solve the classic problem with fading strategies — they blow up in trends — by only trading when a dense acceptance cluster confirms a ranging regime. The ATR scaling means the same settings behave consistently across instruments with very different price scales, and the snap-back body condition avoids entering while price is still extending.

Limitations. No regime filter is perfect. A sufficiently strong or news-driven trend can still slip past the density gate at the moment it begins, and mean-reversion systems characteristically take many small, satisfying wins punctuated by occasional larger losses when a "range" resolves into a breakout. Because the take-profit is the modal price and the stop is a fixed ATR distance, the reward-to-risk on any single trade is not fixed — it depends on how far price has stretched. Fading also underperforms during sustained directional markets, low-liquidity sessions, and around scheduled high-impact news, when acceptance zones break down quickly.

The strategy is best understood as an educational study in statistical fair value and regime filtering — a framework for learning why and when mean reversion can work — rather than a finished, hands-off system.

Risk Management Tips

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