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 MAShortFast MA crosses below Slow MA
- LongFast MA crosses below Slow MAShortFast MA crosses above Slow MA
- LongFast MA is above Slow MAShortFast MA is below Slow MA
- LongFast MA is below Slow MAShortFast MA is above Slow MA
Settings
| Settings | Default | Range |
|---|---|---|
| Fast period | 10 | 2 – 100 |
| Slow period | 30 | 5 – 200 |
| MA type | Simple moving average (SMA) | Simple moving average (SMA) / Exponential moving average (EMA) / Smoothed moving average (SMMA) / Linear weighted moving average (LWMA) |
| Price | Close | Close / 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
- Entry · MA crossover (10, 30, SMA, Close): Fast MA crosses above Slow MA
- Stop-loss 300 points, take-profit 600 points
- 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
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.