Expert_CP_Stoch
This EA uses a Stochastic oscillator combined with a moving average filter to generate trading signals within the MQL5 Standard Library Expert Advisor framework. It employs fixed-lot money management and no trailing stop, relying on fixed stop-loss and take-profit levels for trade exits. The signal threshold mechanism aggregates weighted filter signals before opening or closing positions.
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 | -6.92% | -6.04% | 9.60% | 142 | 43.30% | -1.49 | -0.72 | 6 | −$5.15 | Reliable |
| GBPUSD | -0.25% | -0.22% | 6.54% | 142 | 46.80% | -0.02 | -0.04 | 5 | −$0.34 | Reliable |
| USDJPY | +2.69% | +2.34% | 4.74% | 142 | 59.60% | 0.52 | 0.57 | 5 | +$1.80 | Reliable |
| XAUUSD | -100.00% | -100.00% | 100.00% | 55 | 56.40% | -1.71 | -1.00 | 4 | −$186.84 | Account stopped out |
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 17% of 30 · GBPUSD: better than 53% of 32 · USDJPY: better than 62% of 32 · XAUUSD: better than 0% of 31
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 46% | +1.11% 2026-08 | -2.30% 2026-09 |
| GBPUSD | 54% | +1.83% 2026-01 | -2.68% 2026-03 |
| USDJPY | 69% | +1.85% 2026-03 | -2.07% 2026-08 |
| XAUUSD | 40% | +26.24% 2026-01 | -100.00% 2026-03 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: High
- Hit a stop-out in our backtest (equity below 10%) on XAUUSD
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 uses a Stochastic oscillator as the primary signal generator, combined with a moving average (MA) as an auxiliary filter. Entry conditions rely on Stochastic %K/%D line crossovers in overbought/oversold zones, confirmed by the MA for trend direction, and the aggregated signal must reach the opening threshold (Signal_ThresholdOpen=10) before a position is opened. Exit conditions include the reverse signal reaching the closing threshold (Signal_ThresholdClose=10), stop-loss (50 points) or take-profit (50 points) being hit. Position sizing uses a fixed lot approach (Money_FixLot_Lots=0.1), which does not dynamically adjust based on account balance or volatility. Money management employs the CMoneyFixedLot class with a fixed percentage of 10% and a fixed lot size of 0.1, lacking the ability to dynamically size positions based on volatility or risk. The overall strategy is mean-reversion in nature, exploiting the Stochastic indicator's tendency to revert from overbought/oversold levels, but the relatively tight stop-loss and take-profit (50 points each) may result in frequent stop-outs in volatile markets.
Strengths
- Uses the MQL5 Standard Library framework with clean, modular code structure
- Stochastic oscillator combined with MA provides dual filtering to reduce false signals
- Signal threshold mechanism offers flexible open/close control, preventing overtrading
- Fixed lot sizing reduces position management complexity, suitable for beginners
Weaknesses
- Fixed 50-point stop-loss and take-profit without ATR-based dynamic adjustment, leading to inconsistent performance across varying market conditions
- Fixed lot sizing instead of dynamic position management cannot adapt to account size and risk
- No trailing stop used (CTrailingNone), potentially missing profits from extended trends
- Lacks new bar check mechanism despite EveryTick=false, risking duplicate operations on the same bar
- No spread filter included, which may cause unnecessary losses on high-spread instruments
Possible improvements
- Replace fixed stop-loss/take-profit with ATR-based dynamic calculation to adapt to varying market volatility
- Add a trailing stop module to replace CTrailingNone, protecting profits and following trends
- Add spread filter and new bar check mechanism to improve trade execution reliability
Risk assessment
Overall risk: Medium
- Fixed 50-point stop-loss may be too wide in low-volatility markets and too tight in high-volatility markets, creating asymmetric risk
- Lack of new bar check and spread filter creates risk of duplicate entries and slippage
- Fixed lot sizing ignores account equity changes, maintaining constant risk exposure during losing streaks
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Signal_ThresholdOpen | 10 | Entry signal threshold [0...100] |
Signal_ThresholdClose | 10 | Exit signal threshold [0...100] |
Signal_PriceLevel | 0.0 | Trade execution price level |
Signal_StopLevel | 50.0 | Stop loss level (in points) |
Signal_TakeLevel | 50.0 | Take profit level (in points) |
Signal_Expiration | 4 | Pending order expiration (in bars) |
Signal__StochPeriodK | 33 | Stochastic %K period |
Signal__StochPeriodD | 37 | Stochastic D-line period |
Signal__StochPeriodSlow | 30 | Stochastic slow smoothing period |
Signal__StochApplied | STO_LOWHIGH | Stochastic price application method |
Signal__MAPeriod | 25 | 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.