EA-23040 · Trend Following

Simple EA MA plus MACD

This EA combines a Moving Average crossover or filter with the MACD indicator to generate trend-following trade signals. It enters long positions when the MA signals an uptrend and MACD confirms bullish momentum, and enters short positions under the opposite conditions. The strategy is a classic dual-indicator trend-following system suitable for trending markets.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Blow-up riskLow
Rating★★☆☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsMA, MACD
AuthorCopyright © 2009, Хлыстов Владимир

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD-0.93%-0.81%3.68%10949.10%-0.22-0.256−$0.55Reliable
GBPUSD+6.69%+5.79%4.59%10751.40%1.201.468+$6.25Reliable
USDJPY+3.63%+3.14%4.42%9951.50%0.770.826+$3.66Reliable
XAUUSD-3.39%-2.81%49.78%10451.50%0.34-0.075−$0.88Reliable

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 Trend Following EAs with a reliable result on the same market: EURUSD: better than 45% of 95 · GBPUSD: better than 93% of 95 · USDJPY: better than 85% of 95 · XAUUSD: better than 47% of 96

Month by month

MarketMonths with a gainBest monthWorst month
EURUSD46%+2.70% 2026-04-1.11% 2026-01
GBPUSD69%+2.65% 2026-04-2.56% 2026-10
USDJPY54%+2.91% 2026-04-1.88% 2026-03
XAUUSD54%+19.82% 2026-01-32.50% 2026-08

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 core strategy concept uses a Moving Average to determine trend direction and the MACD indicator to confirm momentum, representing a classic trend-following approach. Entry conditions involve going long when price is above the MA (or a fast MA crosses above a slow MA) and MACD histogram is positive or the signal line crosses upward; short conditions are the reverse. Exit conditions typically rely on MACD reverse crossovers or MA trend reversal signals, and may also include configurable stop-loss and take-profit parameters. Position sizing uses fixed lot parameters, though some variants may include balance-based dynamic lot calculation. Money management includes maximum position limits and stop-loss settings, but the basic MA plus MACD combination lacks adaptive position adjustment and drawdown control mechanisms. The overall strategy performs well in strong trending markets but is prone to frequent false signals and consecutive losses during ranging or choppy conditions.

Strengths

  • Simple and clear strategy logic that is easy to understand and debug, suitable for beginners learning EA development
  • Dual indicator confirmation mechanism (MA+MACD) reduces false signals from a single indicator
  • Highly configurable parameters allow users to flexibly adjust indicator settings for different instruments and timeframes

Weaknesses

  • Both MA and MACD generate numerous false signals during ranging markets, leading to frequent opening and closing of losing trades
  • Lacks advanced money management mechanisms such as dynamic position sizing, maximum drawdown control, and new bar checking
  • Default stop-loss and take-profit are zero, users must manually configure them or face extremely high trading risk

Possible improvements

  • Add a trend filter and ranging market detection mechanism, such as the ADX indicator, to pause trading during low trend strength and avoid false signals in sideways markets
  • Implement equity-based dynamic position sizing and maximum drawdown limits to improve capital safety and strategy robustness

Risk assessment

Overall risk: Medium

  • Default stop-loss and take-profit are zero, creating unlimited loss risk if users do not manually configure them
  • Lacks new bar checking mechanism, potentially causing excessive trading by repeatedly opening and closing positions within the same candle
  • Trend-following strategy produces consecutive losses in ranging markets with no overall drawdown control

Evaluation scores

Code quality3.0
Strategy logic3.0
Risk management2.0
Robustness2.0
Innovation2.0
Documentation2.0
Overall2.3

Parameters

ParameterDefaultDescription
MAPeriod14Moving average period
MAMethodMODE_SMAMoving average calculation method
MAAppliedPricePRICE_CLOSEMoving average applied price
FastEMA_Period12MACD fast EMA period
SlowEMA_Period26MACD slow EMA period
SignalSMA_Period9MACD signal SMA period
LotSize0.1Trade lot size per order
StopLoss0Stop loss in points
TakeProfit0Overall take profit target in points

Similar Trend Following 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.