EA-318 · Mean Reversion

Expert_AML_Stoch

This EA uses a custom CML_Stoch indicator (a modified Stochastic oscillator combined with a moving average filter) to generate trading signals within the MQL5 Standard Library Expert Advisor framework. It opens and closes positions based on configurable signal thresholds, employing fixed lot sizing with no trailing stop mechanism.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskHigh risk
Blow-up riskLow
Rating★★☆☆☆
TypeTrading EA
TimeframesM15, H1, H4
IndicatorsStochastic Oscillator, Moving Average
AuthorMetaQuotes Software Corp.

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD-8.17%-7.14%13.54%5138.00%-1.52-0.608−$17.01Reliable
GBPUSD-0.38%-0.33%9.58%5346.20%-0.02-0.045−$1.30Reliable
USDJPY+2.53%+2.19%5.40%1640.00%0.390.474+$12.23Reliable
XAUUSD-9.86%-8.22%66.21%3528.60%0.20-0.1510−$28.17Reliable

Profitable on 1 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 10% of 30 · GBPUSD: better than 50% of 32 · USDJPY: better than 59% of 32 · XAUUSD: better than 42% of 31

Month by month

MarketMonths with a gainBest monthWorst month
EURUSD31%+1.68% 2026-01-3.19% 2026-09
GBPUSD54%+2.30% 2026-01-3.60% 2026-02
USDJPY46%+2.37% 2026-03-1.48% 2025-12
XAUUSD38%+53.30% 2026-01-41.74% 2026-06

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

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 of this EA is based on the CML_Stoch indicator, a custom signal filter that combines a traditional Stochastic oscillator with a moving average. Entry conditions are governed by Signal_ThresholdOpen (default 40) and Signal_ThresholdClose (default 20), opening positions when signal strength exceeds the open threshold and closing when it drops below the close threshold. The Stochastic parameters are K-period 3, D-period 36, and slowing period 25, which means the indicator is sensitive to short-term price movements while the smoothed line reacts slowly, tending to capture reversal signals in overbought/oversold zones, classifying it as a mean reversion strategy. Position sizing uses fixed lots (MoneyFixedLot, default 0.1 lots) without dynamic adjustment based on account balance. Money management sets a 10% percent parameter but actually uses fixed lot sizing, and both stop loss and take profit levels are set to 0, relying on signal thresholds for exit rather than hard stops, which represents a significant risk management deficiency.

Strengths

  • Built on the standard CExpert framework with clean, well-structured code that is easy to maintain and extend
  • Uses a custom CML_Stoch indicator combining Stochastic and moving average, offering some strategic innovation
  • Signal threshold mechanism provides flexible entry/exit control adaptable to different market conditions

Weaknesses

  • Both stop loss and take profit are set to 0, relying entirely on signal thresholds for exit, which can cause massive losses during extreme market conditions
  • Fixed lot sizing does not account for account size changes and cannot dynamically adjust risk exposure
  • No trailing stop mechanism (uses TrailingNone), profitable positions cannot lock in floating profits
  • Missing spread filter, which can erode profits in a mean reversion strategy where high spreads are detrimental
  • No new bar check mechanism (EveryTick=false mitigates this somewhat but is not rigorous enough)

Possible improvements

  • Add hard stop loss and take profit settings as a safety net beyond signal-based exits to prevent uncontrolled losses during extreme market conditions
  • Implement dynamic position sizing that adjusts lot size based on account balance and ATR volatility
  • Add a trailing stop module to replace TrailingNone, protecting floating profits and improving risk-reward ratio

Risk assessment

Overall risk: High risk

  • Stop loss and take profit are both 0, providing no hard protection during extreme market conditions, potentially leading to massive losses
  • Fixed lot size does not adapt to account changes, automatically increasing risk ratio after losses, posing over-leveraging risk
  • Missing spread filter and slippage protection, may execute at unfavorable prices in low-liquidity markets

Evaluation scores

Code quality4.0
Strategy logic3.0
Risk management1.0
Robustness2.0
Innovation3.0
Documentation2.0
Overall2.5

Parameters

ParameterDefaultDescription
Expert_TitleExpert_AML_StochEA document name
Expert_MagicNumber3765EA magic number (not used for trading)
Expert_EveryTickfalseExecute every tick
Signal_ThresholdOpen40Entry signal threshold [0...100]
Signal_ThresholdClose20Exit signal threshold [0...100]
Signal_PriceLevel0.0Trade execution price level
Signal_StopLevel0.0Stop loss level (in points)
Signal_TakeLevel0.0Take profit level (in points)
Signal_Expiration6Pending order expiration (in bars)
Signal__StochPeriodK3Stochastic K period
Signal__StochPeriodD36Stochastic D-line period
Signal__StochPeriodSlow25Stochastic slow smoothing period
Signal__StochAppliedSTO_LOWHIGHStochastic price application method
Signal__MAPeriod3Additional moving average period
Signal__Weight1.0Signal filter weight [0...1.0]
Money_FixLot_Percent10.0Money management percentage
Money_FixLot_Lots0.1Fixed trading lot size

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.