EA-23319 · Mean Reversion

Dynamic averaging

This EA implements a dynamic averaging strategy that opens positions when price deviates significantly from a calculated average, aiming to profit from price reversion to the mean. It dynamically adjusts the averaging period and thresholds based on market volatility conditions. The system manages multiple orders with incremental lot sizing as price moves further from the average.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskHigh risk
Blow-up riskLow
Rating★★☆☆☆
TypeTrading EA
TimeframesM15, H1, H4
IndicatorsMA, ATR
AuthorCopyright © 2018, Vladimir Karputov

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD-1.73%-1.50%4.50%10847.70%-0.39-0.388−$1.29Reliable
GBPUSD+6.18%+5.35%3.15%11054.50%1.201.967+$5.62Reliable
USDJPY+1.00%+0.87%4.67%11049.10%0.230.217+$0.91Reliable
XAUUSD-53.83%-47.20%76.76%10946.30%0.09-0.709−$47.55Reliable

Profitable on 2 of 4 markets with reliable results.

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.

Against the other Mean Reversion EAs with a reliable result on the same market: EURUSD: better than 57% of 30 · GBPUSD: better than 91% of 32 · USDJPY: better than 50% of 32 · XAUUSD: better than 26% of 31

Month by month

MarketMonths with a gainBest monthWorst month
EURUSD31%+3.35% 2026-04-1.57% 2026-10
GBPUSD77%+3.11% 2026-04-2.21% 2026-01
USDJPY38%+2.99% 2026-04-1.91% 2026-03
XAUUSD38%+71.39% 2026-04-49.17% 2026-08

From the backtest equity curve, sampled about every two days; only reliable results.

Blow-up risk: No blow-up pattern found

None of the usual blow-up patterns were found in the code, 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 strategy concept is based on dynamic mean reversion, assuming that when price deviates significantly from a moving average, the market is overextended and price will revert to the mean. Entry conditions trigger when price deviates beyond a set threshold percentage from the dynamically calculated average, with an initial position opened on the first deviation and additional positions added as deviation increases. Exit conditions close all positions when price returns near the average or reaches a take-profit target. Position sizing uses incremental lot increases, where each additional order scales up by a configured multiplier, similar to averaging down cost basis. Money management calculates initial lot size based on account balance and risk parameters, but incremental position additions can lead to excessive total exposure. The strategy lacks a hard stop-loss, creating risk of sustained position accumulation leading to significant drawdowns.

Strengths

  • Dynamically adjusting the averaging period adapts to different market volatility regimes, offering more flexibility than fixed-period moving averages
  • Mean reversion strategy performs well in ranging markets with clear and understandable logic
  • Incremental position sizing accelerates breakeven and profit when price reverts
  • Maximum order count limit provides some control over total risk exposure
  • Magic number for order management prevents conflicts with other EAs

Weaknesses

  • Lack of hard stop-loss means sustained position accumulation in trending markets can lead to catastrophic losses
  • Incremental lot sizingessentially approaches martingale behavior, requiring exponentially growing capital
  • Spread and slippage costs are not factored in, which can erode profits on short-term reversion trades
  • Mean reversion performs poorly in strong trending markets without a trend filter mechanism
  • Dynamic averaging parameter optimization risks overfitting to historical data

Possible improvements

  • Add a hard stop-loss mechanism, either as a maximum acceptable loss percentage or fixed pip stop, to prevent unlimited position accumulation in one-directional markets
  • Implement a trend filter (such as ADX or higher-timeframe moving average direction) to prohibit counter-trend averaging in strong trending conditions

Risk assessment

Overall risk: High risk

  • Incremental position sizing without hard stop-loss can lead to account blow-up in extreme trending markets
  • Maximum order limit of 5 still permits 5x incremental positions, potentially exceeding account capacity
  • Lack of new bar check may cause multiple entries within the same candle

Evaluation scores

Code quality3.0
Strategy logic2.0
Risk management1.0
Robustness2.0
Innovation3.0
Documentation1.0
Overall2.0

Parameters

ParameterDefaultDescription
AveragingPeriod20Dynamic moving average calculation period
DeviationThreshold0.5Opening deviation threshold percentage
LotSize0.01Initial opening lot size
LotMultiplier1.5position additionlot size multiplier
MaxOrders5Maximum position additions
TakeProfitPips50Take profit in points
MagicNumber12345Unique order identifier number

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.