EA-1896 · Momentum

Long/Short ExpertMACD

This EA is a MACD-based long/short trading expert that extends the standard MQL5 CExpert framework with a custom CLongShortExpertModified class. It generates trade signals from MACD crossover logic and allows the user to restrict trading to long-only, short-only, or both directions. The EA uses no trailing stop and no money management module, relying solely on fixed take-profit and stop-loss levels for trade exits.

Open the interactive view (equity curve, symbol switch)

Key facts

CategoryMomentum
RiskMedium
Blow-up riskLow
Rating★★★☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsMACD
Author2009-2013, MetaQuotes Software Corp - 2013, jlwarrior

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD+5.89%+5.10%2.41%13252.70%1.372.445+$4.76Reliable
GBPUSD+1.97%+1.71%3.49%13048.10%0.390.564+$1.71Reliable
USDJPY-7.40%-6.46%10.39%13046.90%-1.38-0.715−$5.69Reliable
XAUUSD-57.18%-50.38%83.69%13848.20%-0.09-0.686−$39.93Reliable

Profitable on 2 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 90% of 68 · GBPUSD: better than 77% of 66 · USDJPY: better than 7% of 68 · XAUUSD: better than 37% of 75

Month by month

MarketMonths with a gainBest monthWorst month
EURUSD77%+3.05% 2026-04-1.64% 2026-09
GBPUSD54%+1.88% 2026-04-1.76% 2026-01
USDJPY38%+1.56% 2025-12-3.59% 2026-01
XAUUSD38%+53.65% 2026-07-31.99% 2026-05

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 of this EA is based on momentum signals from the MACD indicator, using crossover of the fast and slow MACD lines to determine market direction and generate entry signals. Entry conditions are determined by the CSignalMACD module: a long position is opened when the MACD main line crosses above the signal line, and a short position when it crosses below, with the Inp_Allowed_Positions parameter controlling whether long, short, or both directions are permitted. Exit conditions use fixed take-profit and stop-loss values set by Inp_Signal_MACD_TakeProfit and Inp_Signal_MACD_StopLoss respectively, with no trailing stop functionality (CTrailingNone). Position sizing is not dynamically managed since the EA uses CMoneyNone, meaning lot size must be manually configured in the EA properties. Money management is entirely absent, so the trader must manually control risk exposure as the EA does not auto-calculate position sizes based on account balance or risk ratios. Overall, this is a cleanly structured but relatively basic MACD momentum-following system.

Strengths

  • Built on the standard MQL5 CExpert framework with clean, well-structured code that is easy to understand and maintain
  • Supports position direction control (Inp_Allowed_Positions), offering high flexibility to adapt to different market views
  • Uses standard library modules (CSignalMACD, etc.) with a modular design that makes it easy to replace or extend signal, trailing, and money management components

Weaknesses

  • No money management module at all (CMoneyNone), so position sizes are never auto-adjusted based on account risk
  • No trailing stop mechanism (CTrailingNone), meaning profitable trades cannot lock in floating gains through trailing stops
  • Stop-loss (20) is smaller than take-profit (50) but the ratio is modest, and MACD signals can generate frequent false signals in ranging markets leading to consecutive losses
  • Lacks spread filtering and new bar detection, which may result in unfavorable fills in low-liquidity or high-spread environments

Possible improvements

  • Add a dynamic money management module (e.g., MoneyFixedMargin or MoneyFixedRisk) to auto-calculate position sizes based on account balance and risk ratio
  • Add a trailing stop module (e.g., TrailingFixedPips or TrailingMA) to lock in more profit during trending moves
  • Add spread filtering and new bar detection logic to avoid opening positions during high spreads or repeated entries within the same bar

Risk assessment

Overall risk: Medium

  • No money management module means position sizing relies entirely on manual configuration, posing over-leveraging risk
  • No trailing stop means profitable trades can turn into losses when the trend reverses
  • MACD tends to generate false signals in ranging markets, leading to frequent stop-outs

Evaluation scores

Code quality4.0
Strategy logic3.0
Risk management2.0
Robustness3.0
Innovation2.0
Documentation2.0
Overall2.7

Parameters

ParameterDefaultDescription
Inp_Expert_TitleLong/Short ExpertMACDEA title name
Inp_Allowed_PositionsBOTH_POSITIONAllowed position direction (long only/short only/both)
Inp_Signal_MACD_PeriodFast12MACD fast line period
Inp_Signal_MACD_PeriodSlow24MACD slow line period
Inp_Signal_MACD_PeriodSignal9MACD signal line period
Inp_Signal_MACD_TakeProfit50Take profit in points
Inp_Signal_MACD_StopLoss20Stop loss in points

Similar Momentum EAs

Backtests are historical simulations and do not guarantee future results. Not financial advice.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.