Skip to content
72lab

MA crossover EA: no-code builder for MT4 / MT5

TrendGo long when the fast MA crosses above the slow MA (golden cross) and short when it crosses below (death cross): the classic trend-following rule. Shorter periods give more signals, and more false ones too.

Rules you can build with it

Works as an entry rule or an exit rule. Short rules are mirrored automatically.

  • LongFast MA crosses above Slow MA
    ShortFast MA crosses below Slow MA
  • LongFast MA crosses below Slow MA
    ShortFast MA crosses above Slow MA
  • LongFast MA is above Slow MA
    ShortFast MA is below Slow MA
  • LongFast MA is below Slow MA
    ShortFast MA is above Slow MA

Settings

SettingsDefaultRange
Fast period102 – 100
Slow period305 – 200
MA typeSimple moving average (SMA)Simple moving average (SMA) / Exponential moving average (EMA) / Smoothed moving average (SMMA) / Linear weighted moving average (LWMA)
PriceCloseClose / Opening price / High / Low / Median price / Typical price / Weighted close

How the backtest and the EA calculate it

Both the fast and slow lines use MT5's built-in Moving Average; a crossover is judged only on the last two closed candles, never on the one still forming.

Signals use only closed candles and are filled at the next candle's open. The exported EA checks conditions in the same order, so you get similar results in the MT5 Strategy Tester.

Example strategies

Example 1
  • Entry · MA crossover (10, 30, SMA, Close): Fast MA crosses above Slow MA
  • Stop-loss 300 points, take-profit 600 points
Open in the EA Workshop
Example 2
  • Entry · MA crossover (10, 30, SMA, Close): Fast MA crosses above Slow MA
  • Entry · ADX (14): ADX is above 25
  • Stop-loss 300 points, take-profit 600 points
Open in the EA Workshop

Examples are just a starting point: open one to change settings or add filters, then check it with backtests and robustness tests. Backtest results don't indicate future returns.