MACD signal crossover
MACD shows how a fast and a slow moving average of price move together and apart. The signal line is a smoothed MACD. When MACD crosses it upward the momentum passes to the buyers, and when it crosses downward, to the sellers.
Choose a platform: MT5 shows the chart and Inputs screenshots from MetaTrader 5, MT4 shows the chart with entries and the Inputs screenshot from MetaTrader 4.
How the robot trades
When it buys
The MACD line crosses the signal line upward.
When it sells
The MACD line crosses the signal line downward.
When it exits
A buy closes when MACD drops below the signal line; a sell closes when it rises above it.
Screenshot 1 of 5
The conditions as constructor blocks
Open a buy
Open a sell
Close a buy
Close a sell
Inputs
These inputs appear in the expert advisor settings in MetaTrader 5 or MetaTrader 4, and they are what the strategy tester goes through when it optimises the robot.
| Input | Default | What it means |
|---|---|---|
| InpMACD_Main_fastEma | 12 | Period of the fast moving average MACD is built from. |
| InpMACD_Main_slowEma | 26 | Period of the slow moving average MACD is built from. |
| InpMACD_Main_signal | 9 | Smoothing period of the signal line: the larger it is, the smoother the line. |


How to tune the robot to your style
- Change the periods and watch how the number of signals changes.
- Switch the price the indicator uses in its properties.
- Add a condition that MACD is above or below zero to skip some of the signals.
You can do all of this in the constructor without signing up. To save your changes and come back to them later, you need an account.
Risks
How a strategy behaved in the past does not predict its future results. Check the robot in the strategy tester and on a demo account first, and only then decide whether to trade it with real money. This robot is an example to adapt to your instrument, timeframe and risk rules.