Skip to content
72lab

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 rises
    ShortMACD line falls
  • LongMACD line falls
    ShortMACD 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 up
    ShortMACD line turns down
  • LongMACD line turns down
    ShortMACD line turns up

Settings

SettingsDefaultRange
Fast period122 – 50
Slow period265 – 100
Signal period92 – 30
PriceCloseClose / 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

Example 1
  • Entry · MACD (12, 26, 9, Close): MACD line rises
  • Stop-loss 300 points, take-profit 600 points
Open in the EA Workshop
Example 2
  • 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
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.