MACD Stochastic 2
This EA combines MACD and Stochastic oscillator signals to generate trade entries. It uses MACD for trend direction confirmation and Stochastic for overbought/oversold momentum timing. Trades are opened when both indicators align, providing a dual-confirmation momentum trading system.
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 | +5.52% | +4.78% | 2.92% | 114 | 55.30% | 1.39 | 1.89 | 5 | +$4.85 | Reliable |
| GBPUSD | +4.27% | +3.70% | 4.45% | 116 | 52.20% | 0.75 | 0.96 | 6 | +$3.92 | Reliable |
| USDJPY | -3.05% | -2.66% | 6.71% | 116 | 42.20% | -0.54 | -0.46 | 6 | −$2.63 | Reliable |
| XAUUSD | +96.58% | +74.79% | 69.99% | 118 | 50.80% | 1.15 | 1.38 | 5 | +$81.84 | Reliable |
Profitable on 3 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 Momentum EAs with a reliable result on the same market: EURUSD: better than 87% of 68 · GBPUSD: better than 88% of 66 · USDJPY: better than 32% of 68 · XAUUSD: better than 91% of 75
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 62% | +3.30% 2026-03 | -1.69% 2026-04 |
| GBPUSD | 62% | +3.38% 2026-02 | -3.17% 2026-04 |
| USDJPY | 31% | +2.50% 2026-08 | -1.78% 2026-02 |
| XAUUSD | 46% | +140.03% 2026-02 | -51.83% 2026-01 |
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 a dual-confirmation momentum trading system combining MACD and Stochastic indicators. Entry conditions: for long trades, MACD main line must be above the signal line and Stochastic crosses up from the oversold zone; for short trades, MACD main line must be below the signal line and Stochastic crosses down from the overbought zone. Exit conditions rely on fixed take-profit and stop-loss levels or indicator reversal signals. Position sizing uses fixed lots without dynamic adjustment based on account equity. Money management lacks risk-proportional control and does not implement volatility-adaptive position sizing. The overall strategy logic is clear but lacks a market state filter (trending vs ranging) to avoid whipsaws in sideways markets.
Strengths
- Dual-indicator confirmation reduces false signals and improves entry quality
- MACD and Stochastic are complementary: MACD captures trend direction while Stochastic pinpoints entry timing
- Strategy logic is intuitive and easy to understand, facilitating parameter optimization and backtesting
Weaknesses
- Fixed lot sizing does not adapt to account size changes, making money management inflexible
- Lacks market state filtering, prone to frequent losing signals in ranging markets
- No new bar detection mechanism, potentially opening duplicate positions on the same bar
Possible improvements
- Add ATR-based dynamic stop-loss and take-profit for volatility-adaptive exit levels
- Add a trend filter (e.g., ADX or higher timeframe MA) to avoid frequent trading in ranging markets
Risk assessment
Overall risk: Medium
- Lack of new bar detection may cause duplicate position openings on the same bar
- Fixed lot size does not dynamically adjust based on account risk tolerance
- No spread filter, entry costs may be too high in high-spread environments
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
LotSize | 0.1 | Fixed trading lot size |
MACD_FastEMA | 12 | MACD fast EMA period |
MACD_SlowEMA | 26 | MACD slow EMA period |
MACD_SignalSMA | 9 | MACD signal SMA period |
Stoch_KPeriod | 14 | Stochastic %K period |
Stoch_DPeriod | 3 | Stochastic %D period |
Stoch_Slowing | 3 | Stochastic oscillator slowing value |
Stoch_Oversold | 20 | Oversold threshold |
Stoch_Overbought | 80 | Overbought threshold |
StopLoss | 50 | Stop loss amount, 0 disables overall stop loss |
TakeProfit | 100 | Hedge pair net profit target in points |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.