EA-18440 · Trend Following

Crossing of two iMA

This EA implements a classic dual moving average crossover strategy, generating buy signals when a fast moving average crosses above a slow moving average and sell signals when the fast MA crosses below the slow MA. It uses the built-in iMA indicator of MQL5 for both moving average calculations. Trades are opened on crossover signals with configurable lot size, stop loss, and take profit levels.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Blow-up riskLow
Rating★★☆☆☆
TypeTrading EA
TimeframesM15, H1, H4
IndicatorsMA
AuthorCopyright © 2017, Vladimir Karputov

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD-3.13%-2.73%4.46%11750.00%-0.71-0.704−$2.41Reliable
GBPUSD+2.92%+2.53%4.08%11649.60%0.530.728+$2.74Reliable
USDJPY-1.72%-1.50%5.81%11048.20%-0.32-0.306−$1.56Reliable
XAUUSD-1.82%-1.51%58.51%11149.10%0.34-0.037+$0.60Reliable

Profitable on 1 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 22% of 95 · GBPUSD: better than 72% of 95 · USDJPY: better than 35% of 95 · XAUUSD: better than 48% of 96

Month by month

MarketMonths with a gainBest monthWorst month
EURUSD31%+1.57% 2026-04-1.51% 2026-01
GBPUSD62%+2.68% 2025-12-2.63% 2026-10
USDJPY46%+2.88% 2026-04-2.14% 2026-03
XAUUSD46%+49.38% 2026-02-29.03% 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

This EA employs a dual moving average crossover trend-following strategy, where the core concept is using the intersection of two moving averages with different periods to detect trend direction changes. Entry conditions are straightforward: a buy signal is generated when the fast MA crosses above the slow MA, and a sell signal is triggered when the fast MA crosses below the slow MA, which essentially captures trend reversal moments. Exit conditions rely on fixed stop loss and take profit parameters, closing positions when price hits the preset SL or TP levels, and reverse crossover signals may also trigger position closure. Position sizing uses a fixed lot size specified by the Lots parameter, with no dynamic adjustment mechanism based on account equity or balance. Money management is relatively simplistic, relying solely on the stop loss to take profit ratio to control the risk-reward profile of each trade, lacking account-level risk controls such as maximum drawdown limits or percentage-based position sizing. The overall strategy logic is clear but basic, representing a typical entry-level trend-following approach.

Strengths

  • Strategy logic is simple and clear, easy to understand and verify, suitable for beginners to learn from and improve
  • Uses MQL5 built-in iMA indicator handles for efficient calculation consistent with platform standards
  • Configurable stop loss and take profit parameters provide a basic risk control framework

Weaknesses

  • Fixed lot sizing cannot dynamically adjust position size based on account size and volatility, making money management crude
  • MA crossover strategies generate numerous false signals in ranging/choppy markets leading to frequent losses
  • Lacks new bar detection mechanism, potentially opening redundant trades on the same bar

Possible improvements

  • Add new bar detection logic to ensure each crossover signal triggers only one trade, avoiding redundant entries
  • Implement ATR-based dynamic stop loss and position sizing to adaptively adjust risk parameters based on market volatility

Risk assessment

Overall risk: Medium

  • Lack of new bar detection may cause repeated entries on the same signal, increasing unnecessary risk exposure
  • Frequent false signals in ranging markets may lead to consecutive stop losses and accumulated losses
  • Fixed lot size does not adjust with account balance, potentially unable to sustain trading after significant drawdown

Evaluation scores

Code quality3.0
Strategy logic2.0
Risk management2.0
Robustness2.0
Innovation1.0
Documentation2.0
Overall2.0

Parameters

ParameterDefaultDescription
FastMA_period10Fast MA period
SlowMA_period30Slow MA period
Lots0.1Fixed trading lot size
StopLoss50Stop loss in points
TakeProfit100Take profit in points
MA_methodMODE_SMAMAmethod (SMA/EMA/SMMA/LWMA)
MA_applied_pricePRICE_CLOSEMA applied price type

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.