EA-22914 · Mean Reversion

Contrarian trade MA

This EA implements a contrarian mean-reversion strategy using moving averages. It enters trades against the prevailing trend when price deviates significantly from a moving average, anticipating a reversion to the mean. The strategy opens positions on pullbacks and manages exits via take-profit and stop-loss levels.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Blow-up riskLow
Rating★★☆☆☆
TypeTrading EA
TimeframesM15, H1, H4
IndicatorsMA
Author—

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD0.00%0.00%0.00%0—————Not convertible yet
GBPUSD0.00%0.00%0.00%0—————Not convertible yet
USDJPY0.00%0.00%0.00%0—————Not convertible yet
XAUUSD0.00%0.00%0.00%0—————Not convertible yet

Why this EA never traded: no entry rule survived the conversion.

Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.

Blow-up risk: No blow-up pattern found

  • Has no stop loss or trailing stop

On its own this is not a typical blow-up pattern, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.

High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →

Strategy analysis

The core strategy concept is contrarian trading, entering positions against the prevailing move when price deviates significantly from a moving average, anticipating a mean reversion. Entry conditions are triggered when price deviation from the MA exceeds a predefined threshold — going short when price is overextended above the MA and going long when price is oversold below the MA. Exit conditions rely on fixed take-profit and stop-loss levels in points, with TP set near the mean reversion target and SL placed where the deviation would continue to widen. Position sizing uses a fixed lot approach with no dynamic lot calculation or ATR-based adaptive sizing. Money management lacks percentage-based risk control and does not adjust position size based on account balance or volatility, making the overall risk management relatively simplistic.

Strengths

  • Clear contrarian logic that performs well in ranging markets
  • Uses MA deviation as entry signal, concept is intuitive and easy to understand
  • Has defined TP/SL providing a basic risk control framework

Weaknesses

  • Fixed lot sizing without dynamic position management cannot adjust exposure to account risk
  • Contrarian strategy suffers continuous losses in strong trending markets, lacks trend filter
  • Missing new bar check may cause repeated entries on the same candle
  • No spread filter makes it vulnerable in high-spread conditions

Possible improvements

  • Add a trend filter (e.g., ADX or higher timeframe MA direction) to avoid counter-trend entries during strong trends
  • Introduce dynamic position sizing based on account equity percentage or ATR
  • Add new bar check and spread filter to improve execution quality

Risk assessment

Overall risk: Medium

  • Fixed lot sizing without dynamic risk control leads to disproportionate exposure with larger accounts
  • Contrarian approach can result in consecutive stop-losses during strong directional moves
  • Missing new bar check may cause duplicate entries on the same candle

Evaluation scores

Code quality2.0
Strategy logic3.0
Risk management2.0
Robustness2.0
Innovation2.0
Documentation1.0
Overall2.0

Parameters

ParameterDefaultDescription
Lots0.1Fixed trading lot size
MAPeriod200Moving average period
MAMethodMODE_SMAMoving average calculation method
MAPricePRICE_CLOSEMoving average applied price type
Deviation500Price deviation from MA in points threshold
StopLoss300Stop loss in points
TakeProfit500Overall take profit target in points
MagicNumber123456EA magic number for trade identification

Similar Mean Reversion EAs

Backtests are historical simulations and do not guarantee future results. Not financial advice.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.