MACD EA
This EA trades based on MACD crossover signals, entering long positions when MACD crosses above its signal line and entering short positions when MACD crosses below. It uses configurable lot sizing and stop loss/take profit levels for risk management. The strategy is a classic momentum-following approach relying on MACD histogram and signal line interactions.
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 | +1.39% | +1.21% | 3.98% | 130 | 47.30% | — | — | — | — | Same as other EAs |
| GBPUSD | +3.37% | +2.92% | 3.45% | 129 | 49.20% | — | — | — | — | Same as other EAs |
| USDJPY | -5.99% | -5.23% | 9.13% | 129 | 52.70% | — | — | — | — | Same as other EAs |
| XAUUSD | -39.73% | -34.19% | 75.80% | 136 | 48.90% | — | — | — | — | Same as other EAs |
On every market this backtest is identical to EA-17136, EA-19977. The automatic conversion almost certainly lost what makes this EA different (a custom indicator, a filter or the money management), so these results are not ranked or counted.
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.
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
This EA employs the classic MACD momentum crossover strategy, with the core concept of using MACD golden cross and death cross signals to determine market trend direction. Entry conditions are based on MACD main line crossing the signal line — golden cross for long entries, death cross for short entries. Exit conditions rely on preset stop loss and take profit parameters, and may also close positions when an opposing crossover signal appears. Position sizing uses a fixed lot approach where the user sets the lot size through the InpLotSize parameter. Money management includes a stop loss parameter to cap per-trade losses, but lacks dynamic position sizing based on account equity or balance. The overall strategy logic is simple and clear, but is prone to frequent false signals in ranging markets leading to consecutive losses.
Strengths
- Simple and clear strategy logic, easy to understand and optimize
- Uses the well-established MACD indicator with solid theoretical foundation widely used in technical analysis
- Provides stop loss and take profit parameters with basic risk control capability
Weaknesses
- Fixed lot position sizing cannot dynamically adjust risk exposure based on account equity
- MACD tends to generate numerous false signals in ranging markets leading to frequent losses
- Lacks new bar check mechanism, potentially opening multiple positions on the same bar
- Lacks spread filter, entry costs may be too high in high-spread environments
Possible improvements
- Add dynamic position sizing to automatically calculate lot size based on account balance and risk ratio
- Add trend filter conditions (e.g., higher timeframe MA direction) to avoid frequent trading in ranging markets
- Add new bar check and spread filter to improve trade quality and reduce false signals
Risk assessment
Overall risk: Medium
- Lacks new bar check, potentially opening duplicate positions on the same bar leading to overexposure
- Fixed lot size cannot adapt to different account sizes, risk may be too high for small accounts
- MACD lag causes delayed entries, stop losses may be frequently triggered
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
InpLotSize | 0.1 | Lot size per trade |
InpStopLoss | 50 | Stop loss in points |
InpTakeProfit | 100 | Take profit in points |
InpFastEMA | 12 | MACD fast EMA period |
InpSlowEMA | 26 | MACD slow EMA period |
InpSignalSMA | 9 | MACD signal SMA period |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.