Blog / Strategy
Strategy

Range Weighted Value 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 Weighted Value Reversion is a mean-reversion trading strategy for MetaTrader 5 that fades price back toward a custom "acceptance value" line built entirely from raw bar geometry (Open, High, Low, Close). Mean reversion is the idea that price tends to snap back toward a fair-value centre after stretching too far away from it. Instead of anchoring to a conventional Simple Moving Average (SMA), Exponential Moving Average (EMA), or Volume Weighted Average Price (VWAP), this strategy computes its own centre of gravity that deliberately ignores the loud, climactic bars that pull ordinary averages off-centre.

The core insight is about weighting. Most fair-value anchors treat every bar equally, so they get dragged around by the very wide "excursion" bars that represent price leaving value — which are exactly the moves a reversion trader wants to fade. Range Weighted Value Reversion instead weights each bar by how quiet it was. A tight, low-range bar (price being accepted by the market) counts near full weight, while a wide, climactic bar (price travelling fast) is pushed toward near-zero weight. The resulting line represents where the market has actually been trading and accepting price, giving a cleaner reference point to revert toward.

This strategy is designed for ranging or balanced market conditions, not trends. It is best suited to traders who want to study how a novel, indicator-free value anchor behaves and how a strategy can gate itself to only fade price inside a range. As with any tool covered here, it is intended as a learning resource for understanding mean-reversion mechanics — not as a shortcut to returns.

How It Works

The strategy evaluates only once per newly closed bar and holds a single position at a time, letting the stop-loss and take-profit manage each trade. Here is the logic in plain English:

Because the take-profit is the value line and the stop is a fixed ATR multiple, each trade has a clearly defined, self-scaling risk-to-reward profile that the strategy verifies is positive before sending any order.

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

Strategy Parameters

Parameter Default Min Max Description
ValuePeriod 30 10 100 Lookback window (in bars) for the range-weighted acceptance-value line and its slope. Larger values create a slower, smoother centre of gravity.
AtrPeriod 14 5 50 Number of bars used to compute the ATR that scales the deviation trigger and the stop distance.
DeviationAtr 2.0 0.5 5.0 How many ATRs price must be stretched from the value line before a fade is armed. Higher values demand a larger stretch and produce fewer, more selective signals.
FlatDriftAtr 1.5 0.2 5.0 Maximum window drift (in ATRs) that still counts as "balance." This is the ranging gate; lower values restrict trading to flatter markets.
StopAtr 1.5 0.5 5.0 Protective stop-loss distance beyond the entry, measured in ATRs.
Lots 0.10 0.01 1.0 Trade volume in lots per position.
range weighted value reversion MT5 — MQL5 source code

Recommended Chart Settings

Range Weighted Value Reversion is a general-purpose mean-reversion framework and does not hard-code a specific symbol. A sensible starting point for study is a major forex pair such as EUR/USD or GBP/USD on an intraday timeframe like M15, M30, or H1, where ranging, balanced conditions occur frequently enough to exercise the strategy's fade logic. Mean-reversion approaches generally struggle to find clean setups on strongly trending instruments, so pairs and periods that spend meaningful time consolidating tend to suit this design.

Remember that results will vary considerably across different symbols, timeframes, brokers, and market conditions. Always test on the specific instrument and period you intend to trade, and re-evaluate the DeviationAtr and FlatDriftAtr gates for each market's typical behaviour.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of this approach. The range-weighted value line is a genuinely thoughtful attempt to solve a real problem with reversion anchors: ordinary averages are distorted by exactly the excursion bars a fader wants to ignore. By down-weighting wide bars, the acceptance line stays closer to where price has been accepted. The explicit ranging gate (FlatDriftAtr) is another disciplined feature — the strategy actively refuses to fade a trend, which is the classic way mean-reversion systems get hurt. Requiring a confirming turn candle also filters out simply catching a falling knife the moment price stretches.

Known limitations. Mean reversion has a structurally asymmetric risk profile: many small wins targeting the value line can be undone by a few large losses when price breaks out of the range and keeps going. No regime filter is perfect, so some fades will inevitably be armed just as a genuine trend begins. The take-profit at the value line can also be a moving target between the signal bar and the fill, and slippage or spread on entry may erode the already-modest reward. Because only one position is held at a time, the strategy may sit idle for long stretches when markets are quiet or, conversely, when they are strongly trending and the ranging gate keeps it out.

Where it may underperform. Strongly trending, news-driven, or gapping markets are the natural weak spot for any fade-the-stretch design. In those conditions the deviation trigger may fire repeatedly against the prevailing move. This EA is best understood as an educational study of value-based reversion, not as a system to deploy unsupervised.

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