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
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | -8.17% | -7.14% | 13.54% | 51 | 38.00% | -1.52 | -0.60 | 8 | −$17.01 | Reliable |
| GBPUSD | -0.38% | -0.33% | 9.58% | 53 | 46.20% | -0.02 | -0.04 | 5 | −$1.30 | Reliable |
| USDJPY | +2.53% | +2.19% | 5.40% | 16 | 40.00% | 0.39 | 0.47 | 4 | +$12.23 | Reliable |
| XAUUSD | -9.86% | -8.22% | 66.21% | 35 | 28.60% | 0.20 | -0.15 | 10 | −$28.17 | Reliable |
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
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 31% | +1.68% 2026-01 | -3.19% 2026-09 |
| GBPUSD | 54% | +2.30% 2026-01 | -3.60% 2026-02 |
| USDJPY | 46% | +2.37% 2026-03 | -1.48% 2025-12 |
| XAUUSD | 38% | +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
Parameters
| Parameter | Default | Description |
|---|---|---|
Expert_Title | Expert_AML_Stoch | EA document name |
Expert_MagicNumber | 3765 | EA magic number (not used for trading) |
Expert_EveryTick | false | Execute every tick |
Signal_ThresholdOpen | 40 | Entry signal threshold [0...100] |
Signal_ThresholdClose | 20 | Exit signal threshold [0...100] |
Signal_PriceLevel | 0.0 | Trade execution price level |
Signal_StopLevel | 0.0 | Stop loss level (in points) |
Signal_TakeLevel | 0.0 | Take profit level (in points) |
Signal_Expiration | 6 | Pending order expiration (in bars) |
Signal__StochPeriodK | 3 | Stochastic K period |
Signal__StochPeriodD | 36 | Stochastic D-line period |
Signal__StochPeriodSlow | 25 | Stochastic slow smoothing period |
Signal__StochApplied | STO_LOWHIGH | Stochastic price application method |
Signal__MAPeriod | 3 | Additional moving average period |
Signal__Weight | 1.0 | Signal filter weight [0...1.0] |
Money_FixLot_Percent | 10.0 | Money management percentage |
Money_FixLot_Lots | 0.1 | Fixed trading lot size |
Similar Mean Reversion EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.