EA-13588 · Trend Following

Exp_EMA-Crossover_Signal

This EA trades based on the EMA-Crossover_Signal custom indicator, opening buy positions on upward crossover signals and sell positions on downward crossover signals. It supports configurable money management modes, stop loss/take profit, and separate toggle controls for opening and closing positions on both sides. The strategy operates on new bar events with a historical bar lookup to determine if opposing positions should be closed.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Rating★★☆☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsEMA, LWMA, EMA-Crossover_Signal
Author—

Backtest results (H1, about 1 year)

Not backtested yet — this EA could not be converted automatically.

Strategy analysis

The strategy concept is based on a crossover of two moving averages with different periods, where the faster MA crossing above the slower MA generates a buy signal and vice versa for sell signals. Entry conditions require the EMA-Crossover_Signal indicator to output a non-zero and non-EMPTY_VALUE signal at the specified SignalBar position, with UpValue triggering long entries and DnValue triggering short entries. Exit conditions include configurable stop loss and take profit in points, and when reverse-close toggles are enabled, the EA scans historical bars to find earlier opposing signals to determine whether to close existing positions. Position sizing is controlled by the MM parameter which sets the lot ratio, supporting five money management modes: free margin-based, balance-based, loss-adjusted free margin, loss-adjusted balance, and fixed lot size. The money management leverages the standardized TradeAlgorithms.mqh library module, providing dynamic position sizing ranging from fixed lots to margin-calculated approaches based on different equity metrics.

Strengths

  • Provides independent toggle switches for opening and closing positions on both sides, offering high flexibility for unidirectional or close-only trading configurations
  • Supports five money management modes from fixed lots to dynamic margin-based sizing, accommodating various risk appetites
  • Uses IsNewBar mechanism to control signal calculation frequency, preventing duplicate trade triggers within the same bar
  • Complete stop loss and take profit parameters with a default 2:1 reward-to-risk ratio (1000 SL vs 2000 TP)
  • Clean code structure leveraging the TradeAlgorithms.mqh library for trade logic encapsulation, reducing code duplication

Weaknesses

  • The FastMA period of 5 and SlowMA period of 6 are too close, which can generate frequent false crossover signals leading to overtrading
  • The reverse-close logic iterates through all historical bars without an upper bound optimization, potentially causing performance issues on long chart histories
  • No spread filter mechanism exists, so signals may be overwhelmed by noise in high-spread environments leading to unfavorable entries
  • Depends on iCustom calling the external EMA-Crossover_Signal indicator, adding deployment complexity and dependency risk
  • The Recount flag is set to true on CopyBuffer failure but only recalculates on the next tick, potentially delaying signals during fast market moves

Possible improvements

  • Increase the gap between FasterMA and SlowerMA periods (e.g., 5 and 20), or add signal confirmation requiring the signal to persist for 2-3 bars to reduce false signals
  • Add a maximum search range limit to the historical bar iteration for reverse-close logic to avoid unnecessary performance overhead on very long chart histories
  • Add spread filter and volatility filter to suppress trading signals in high-spread or low-volatility environments

Risk assessment

Overall risk: Medium

  • The minimal 1-period gap between Fast and Slow MA generates frequent false signals that can lead to consecutive losses
  • The reverse-close logic iterates through all historical bars without an upper bound, posing performance and logic risks
  • Lack of spread filter and maximum position check may cause frequent entries under unfavorable conditions

Evaluation scores

Code quality3.0
Strategy logic2.0
Risk management3.0
Robustness3.0
Innovation1.0
Documentation1.0
Overall2.2

Parameters

ParameterDefaultDescription
MM0.1Money management ratio or lot size
MMModeLOTMoney management mode (free margin/balance/post-loss margin/post-loss balance/fixed lot)
StopLoss_1000Stop loss in points
TakeProfit_2000Take profit in points
Deviation_10Maximum allowed slippage
BuyPosOpentrueAllow opening long positions
SellPosOpentrueAllow opening short positions
BuyPosClosetrueAllow closing long positions
SellPosClosetrueAllow closing short positions
InpInd_TimeframePERIOD_H4EMA Prediction indicator timeframe
FasterMA5Fast moving average period
SlowerMA6Slow moving average period
MATypeMODE_LWMAMoving average calculation method
MAPricePRICE_CLOSEMoving average applied price
SignalBar1Bar index for signal calculation

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.