MACD EA: no-code builder for MT4 / MT5
TrendThe MACD line is the difference between a fast and a slow exponential moving average: above zero means the short-term average is above the long-term one. “MACD line crosses above zero” is a common sign that the trend is getting stronger.
Rules you can build with it
Works as an entry rule or an exit rule. Short rules are mirrored automatically.
- LongMACD line risesShortMACD line falls
- LongMACD line fallsShortMACD line rises
- LongMACD line is above 0 points(adjustable level)ShortMACD line is below 0 points
- LongMACD line is below 0 points(adjustable level)ShortMACD line is above 0 points
- LongMACD line crosses above 0 points(adjustable level)ShortMACD line crosses below 0 points
- LongMACD line crosses below 0 points(adjustable level)ShortMACD line crosses above 0 points
- LongMACD line turns upShortMACD line turns down
- LongMACD line turns downShortMACD line turns up
Settings
| Settings | Default | Range |
|---|---|---|
| Fast period | 12 | 2 – 50 |
| Slow period | 26 | 5 – 100 |
| Signal period | 9 | 2 – 30 |
| Price | Close | Close / Opening price / High / Low / Median price / Typical price / Weighted close |
| Level (points) | 0 | -500 – 500 |
How the backtest and the EA calculate it
The fast and slow lines are exponential moving averages, as in MT5's MACD. Note that MT5's signal line is a simple average (many charting platforms use an exponential one); the backtest follows MT5. Levels are in points.
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 · MACD (12, 26, 9, Close): MACD line rises
- Stop-loss 300 points, take-profit 600 points
- Entry · MACD (12, 26, 9, Close): MACD line rises
- Entry · Moving Average (50, EMA, Close): MA rises
- 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.