TestMACD
This EA uses the standard MetaTrader 5 Expert Advisor framework with a MACD signal module to generate trade entries based on MACD histogram crossover logic. It employs fixed lot sizing with no trailing stop, relying on static stop-loss and take-profit levels for trade management. The EA is a boilerplate implementation built entirely from MQL5 standard library components.
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 | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
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
The core strategy of this EA is MACD momentum trading, constructing the MACD line from the difference between a fast EMA (period 12) and a slow EMA (period 24), then using a signal line (period 9) as the trigger. Entry conditions are determined by the CSignalMACD class internally, typically going long on a golden cross of the MACD line above the signal line and going short on a death cross. Exit conditions rely entirely on a fixed stop-loss of 90 points and a fixed take-profit of 110 points, with no trailing stop strategy employed (CTrailingNone), meaning profitable positions will not lock in floating gains. Position sizing uses the CMoneyFixedLot fixed lot model, always trading 0.1 lots regardless of account balance changes. Although a 10% percent parameter is set, in fixed lot mode it only affects risk calculation while the actual order size remains constant at 0.1 lots, lacking the ability to dynamically adjust position size based on volatility or account risk. The overall strategy is straightforward but lacks adaptability to changing market conditions.
Strengths
- Built on MQL5 standard library components with clean, maintainable code structure
- Uses CExpert framework for modular separation of signal, trailing, and money management, making it easy to swap or extend modules
- All parameters are externally configurable via input variables, facilitating optimization and backtesting
- Trades only on new bar formation (EveryTick=false), reducing overtrading and curve-fitting risks
- Includes complete parameter validation flow (ValidationSettings) to prevent abnormal trading from invalid inputs
Weaknesses
- No trailing stop strategy means profitable positions cannot lock in floating gains, potentially leading to profit givebacks
- Fixed lot position sizing is overly simplistic, lacking dynamic adjustment based on account risk or market volatility
- Stop-loss 90 points and take-profit 110 points yield a risk-reward ratio of only 1:1.22, which is conservative for a MACD momentum strategy
- No market environment filter mechanism; MACD crossover signals frequently generate false signals in ranging markets
- No spread filter or trading session filter, so high-spread periods can erode profits
- Slow EMA period of 24 is non-standard (typically 26), which may be inconsistent with most platform default parameters
Possible improvements
- Add a trailing stop module (e.g., CTrailingFixedPct or CTrailingMA) to protect floating gains and improve profitability
- Replace fixed lot money management with dynamic sizing (e.g., CMoneyFixedRisk) that calculates lot size based on account risk percentage and stop-loss distance
- Add a trend filter condition (e.g., higher timeframe MA direction or ADX indicator) to avoid frequent entries in ranging markets
- Add spread filter and trading session restrictions to avoid trading during low-liquidity, high-spread periods
- Consider adding a MACD histogram zero-line filter, only entering on crossovers where MACD and signal line are on the same side of zero, reducing false signals
Risk assessment
Overall risk: Low
- Fixed 90-point stop-loss provides some downside protection, but lack of trailing stop may cause profitable positions to give back gains
- MACD tends to generate false signals in ranging markets; absence of filtering mechanisms may lead to consecutive small losses
- Fixed lot sizing ignores account size changes, potentially exposing small accounts to excessive risk while underutilizing capital in large accounts
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Inp_Expert_Title | TestMACD | Expert advisor title name |
Expert_MagicNumber | 9424 | EA magic number for identifying its orders |
Expert_EveryTick | false | Execute trading logic on every tick |
Inp_Signal_MACD_PeriodFast | 12 | MACD fast EMA period |
Inp_Signal_MACD_PeriodSlow | 24 | MACD slow EMA period |
Inp_Signal_MACD_PeriodSignal | 9 | MACD signal line period |
Inp_Signal_MACD_StopLoss | 90 | Stop loss in points |
Inp_Signal_MACD_TakeProfit | 110 | Take profit in points |
Inp_Money_FixLot_Percent | 10.0 | Risk percentage for fixed lot money management |
Inp_Money_FixLot_Lots | 0.1 | Fixed trading lot size |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.