Blog / Strategy
Strategy

Semivariance Reversion Fade

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?

The Semivariance Reversion Fade is a mean-reversion trading strategy for MetaTrader 5 built around an idea borrowed from the Sortino ratio: semivariance, which measures the volatility of downside moves and upside moves separately rather than lumping them into a single symmetric number. Most envelope-reversion systems — Bollinger Bands, z-score bands, standard-deviation channels — assume the market wobbles equally in both directions, so their upper and lower rails are mirror images. The Semivariance Reversion Fade rejects that assumption and hangs an asymmetric envelope around a moving-average "fair value" line, scaling the lower rail by downside volatility and the upper rail by upside volatility.

Mean reversion is the trading style at the heart of this system. The core belief is that when price stretches unusually far from a rolling average, it tends to snap back toward that average — and the strategy "fades" (trades against) the stretch, buying when price is over-extended below the lower rail and selling when it is over-extended above the upper rail. Because the two rails breathe independently, the system naturally widens the rail on whichever side is currently more volatile, which helps it avoid fighting one-sided pressure.

As a learning tool, this strategy is well suited to traders who already understand basic moving averages and want to explore how volatility skew — the tendency for down-moves and up-moves to behave differently — can be encoded directly into an entry filter. It is not a "set and forget" money machine; it is a structured example of adaptive, self-scaling logic. Treat it as a case study in asymmetric risk modeling and disciplined mean-reversion design.

How It Works

The strategy acts once per newly-closed bar on the chart's timeframe. It maintains a rolling history of closed bars and computes several ingredients before deciding whether to trade.

Building the fair-value baseline and rails:

Entry conditions — the strategy signals a LONG when:

A SHORT is the mirror image: the close is above the upper rail, the bar is bearish (close below open), and no strong grind is present.

The trend guard: the strategy measures the EMA baseline's slope per bar. If the absolute slope exceeds TrendGuardAtr × ATR, the baseline is moving directionally faster than a chosen fraction of average true range, and the strategy stands aside entirely. This veto is what stops the system from repeatedly fading a strong trend — historically the most dangerous thing a reversion system can do.

Exit logic:

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

Strategy Parameters

Parameter Default Min Max Description
MeanPeriod 20 10 60 EMA lookback for the fair-value baseline that the rails hang from and that serves as the take-profit target.
DevPeriod 40 20 120 Number of bars used to measure the downside/upside semideviation of returns.
DownMult 2.2 1.0 4.0 Width of the lower rail as a multiple of downside semideviation.
UpMult 2.2 1.0 4.0 Width of the upper rail as a multiple of upside semideviation.
TrendGuardAtr 0.30 0.05 1.5 Skip fades when the baseline's per-bar slope exceeds this multiple of ATR.
AtrPeriod 14 5 30 Lookback period for the ATR used to size the protective stop.
AtrStopMult 1.8 0.5 4.0 Protective stop distance beyond entry, as a multiple of ATR.
MinRewardRisk 0.8 0.3 3.0 Minimum acceptable reward-to-risk ratio; setups below this are rejected.
MaxSpreadPoints 80 5 300 Skip new entries when the current spread (in points) is wider than this.
Lots 0.10 0.01 1.0 Fixed order volume in lots.
Magic 5271 0 9,999,999 Unique identifier so the EA manages only its own trades.
semivariance mean reversion MT5 EA — MQL5 source code

Recommended Chart Settings

The Semivariance Reversion Fade is single-timeframe and self-scaling: every calculation uses the chart's own timeframe, so it adapts to whatever period you attach it to. It was designed with liquid FX majors and metals in mind — for example EURUSD, GBPUSD, or XAUUSD — on the M15 to H1 timeframes, where volatility skew and mean-reversion tendencies both tend to appear.

These are starting points for study, not guarantees. Volatility skew, spread behavior, and reversion strength differ across instruments and sessions, so results will vary considerably across different market conditions. Always test any symbol/timeframe combination on your own data before drawing conclusions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of the approach. The asymmetric envelope is the standout idea. By measuring downside and upside volatility separately, the strategy widens the rail on whichever side the market is currently more active — which means that in a sell-off the downside deviation balloons, the lower rail drops away, and casual long-fades stop firing exactly when fading a downtrend would be most dangerous. The EMA-slope trend guard adds a second, independent veto against trading into strong momentum. Everything is self-scaling: the rails, the ATR stop, and the structural EMA target all adapt to volatility rather than relying on fixed pip distances.

Known limitations. Mean-reversion systems are, by design, vulnerable to sustained trends and regime shifts. Semivariance and the trend guard reduce that exposure but cannot eliminate it — a fast, gapping breakout can blow through a rail before the guard's slope estimate catches up. The strategy also assumes reversion actually occurs; in a strongly trending or news-driven market, price may keep stretching rather than snapping back. Because only one position per magic is held, the system trades selectively and may sit idle for long stretches, which is normal but can feel unproductive.

Where it may underperform. Expect weaker behavior during strong directional trends, low-liquidity sessions with erratic spreads, and around major economic releases when volatility skew changes abruptly. Historically, mean-reversion logic tends to do best in ranging, oscillating conditions and worst in one-way markets. This strategy is a tool for studying that trade-off, not a shortcut around it.

Risk Management Tips

Sound risk management matters far more than any single indicator. Consider these general principles as part of your education:

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