MACD Zero Line Filter in MT4: How to Set It Up, and 18 of 120 Filtered Settings Made Money, 14 on Gold M15 and None on EURUSD M5

Key takeaways
- MT4’s built-in MACD draws MACD as a histogram and the signal as a dotted line. The zero line is where the histogram changes sign. Adding level 0 in the Levels tab makes it easy to read, and a 200 EMA goes on the main chart.
- I tested 6 MACD settings with 5 filters on EURUSD and gold, M5 and M15: 120 combinations, 18 made money after cost. 14 of them were on gold M15, 4 on EURUSD M15, none on either M5 chart.
- Only 6 of 120 made money in both halves of the data, all on gold M15. All 6 used the 200 EMA, the slow 24/52/9 setting, or both.
- Picking the best setting on the first half did not work. The first-half winner ranked 30th of 30 in the second half on EURUSD M5 and 28th of 30 on gold M15.
- Trend side plus 200 EMA was the filter with the most profitable cells, 6 of 24, and also the filter behind the worst cell on EURUSD M5.
The zero-line filter is one of the first things people add to MACD in MetaTrader. It needs no extra indicator: the line is already in the MACD window. The question is which way to use it and with which settings, and that is where most guides stop.
This guide shows how to set it up in MT4 and MT5, then what 120 setting-and-filter combinations did on the same data I use for every test on this blog.
How do you add MACD with a zero line in MT4?

- Insert, Indicators, Oscillators, MACD. Inputs: Fast EMA 12, Slow EMA 26, MACD SMA 9, Apply to Close.
- Levels tab, Add, value 0. MT4 draws the histogram from zero but does not draw the line itself. A dotted level at 0 makes the side of zero visible at a glance.
- Insert, Indicators, Trend, Moving Average. Period 200, MA method Exponential, Apply to Close. This is the trend filter on the price chart.
- Save it as a template (right-click the chart, Template, Save Template) so the three parts load together. The same idea for a full indicator set is in multi-indicator MT4 template.
In MT5 the path is the same: Insert, Indicators, Oscillators, MACD, then the Levels tab. Both platforms draw MACD as bars and smooth the signal line with a simple average. Textbook MACD uses an exponential signal line, which is what I tested here. The difference between the two and how much the signal line matters are in MACD settings for MT4.
How do you read the zero line on the MT4 MACD?

| What you see in MT4 | What it means |
|---|---|
| Histogram bar moves above the dotted signal line | Bullish signal-line cross, the usual MACD entry |
| That happens while the bars are below 0 | Textbook side: momentum turned before the averages did |
| That happens while the bars are above 0 | Trend side: the 12 EMA is already above the 26 EMA |
| Histogram changes from negative to positive | Zero cross, the same event as an EMA 12/26 crossover |
| Price above the 200 EMA | The 200 EMA filter allows longs only |
Bearish crosses are the mirror image. What each kind of cross did on its own is in MACD cross above vs below the zero line. The short version: the trend-side cross came 3.3 to 4.2 ATR into the move, the textbook cross 2.0 to 2.5, and neither made more by more than noise.
Which settings and filters were tested?
- Six MACD settings: the default 12/26/9, the fast 8/17/9, 5/35/5, 3/10/16, the slow 24/52/9 and 19/39/9.
- Five filters: none, textbook side only, trend side only, 200 EMA only, trend side plus 200 EMA.
- Four charts: EURUSD M5 (16,926 bars from June 3 to August 26, 2026) and M15, gold M5 (13,736 bars from June 16) and M15.
- Exit: stop 1.5 ATR, target 3 ATR, 48 bars at most, one trade at a time. Cost 1 pip on EURUSD, $0.30 an ounce on gold.
- Halves: split on July 15, to see if a setting held up after the period it looked good in.
How many of the 120 combinations made money?
| Profitable cells, of 6 settings | EURUSD M5 | EURUSD M15 | Gold M5 | Gold M15 | Total of 24 |
|---|---|---|---|---|---|
| No filter | 0 | 0 | 0 | 2 | 2 |
| Textbook side | 0 | 0 | 0 | 2 | 2 |
| Trend side | 0 | 2 | 0 | 2 | 4 |
| 200 EMA | 0 | 0 | 0 | 4 | 4 |
| Trend + 200 EMA | 0 | 2 | 0 | 4 | 6 |
| All filters | 0 of 30 | 4 of 30 | 0 of 30 | 14 of 30 | 18 of 120 |
Profitable means positive average per trade after cost, every cell had at least 60 trades.
The chart mattered far more than the filter. Gold M15 had 14 profitable cells, both M5 charts had none. On EURUSD M5 the 30 cells lost between 0.95 and 1.95 pips a trade. The least bad was 3/10/16 with the trend-side filter, and the trend side was the least bad filter for all three fast settings. It was still a loss of nearly a pip a trade.
On EURUSD M15 the 4 profitable cells were all slow settings on the trend side: 24/52/9 and 19/39/9, with and without the 200 EMA. All 4 lost money in the second half. The best, 19/39/9 trend plus 200 EMA, made +4.26 pips a trade before July 15 and -1.50 after.
Which settings held up in both halves?
| Gold M15 | Trades | Per trade | First half | Second half |
|---|---|---|---|---|
| 24/52/9, 200 EMA | 85 | +2.82 | +8.56 | +0.15 |
| 12/26/9, trend + 200 EMA | 69 | +2.17 | +4.16 | +1.18 |
| 24/52/9, no filter | 138 | +1.35 | +3.74 | +0.07 |
| 12/26/9, 200 EMA | 117 | +1.21 | +2.01 | +0.84 |
| 24/52/9, textbook side | 119 | +1.01 | +0.02 | +1.55 |
| 3/10/16, 200 EMA | 169 | +0.65 | +0.06 | +0.98 |
Dollars an ounce after $0.30 of cost.
Six of 120 were positive in both halves, all on gold M15. Look at the halves before getting excited. Three of the six made almost all their money in one half: +$8.56 then +$0.15, +$3.74 then +$0.07, +$0.02 then +$1.55. Only two were clearly positive in both: the default 12/26/9 with the 200 EMA, alone or with the trend-side cross. Those two did not beat the random-entry benchmark in the full filter test, which needed +$3.76 and +$4.78 a trade on so few trades.
Can you optimise MACD on the first half and trade the second?
This is what the MT4 Strategy Tester invites you to do: run all the settings, keep the best. I picked the best cell of the first half on each chart and checked where it ranked in the second half among the same 30.
| Chart | Best in first half | First half | Second half | Rank in second half |
|---|---|---|---|---|
| EURUSD M5 | 24/52/9, trend + 200 EMA | -0.36 | -2.33 | 30 of 30 |
| EURUSD M15 | 19/39/9, trend + 200 EMA | +4.26 | -1.50 | 10 of 30 |
| Gold M5 | 8/17/9, textbook side | +0.15 | -0.24 | 17 of 30 |
| Gold M15 | 24/52/9, trend side | +14.30 | -2.01 | 28 of 30 |
None of the four first-half winners made money in the second half. Two of them went from first to last or nearly last. The gold M15 cell is the warning: +$14.30 an ounce a trade on 23 trades, then -$2.01 on 44. A setting that looks that good on a short run is usually a few lucky trades. The same thing happened to every optimiser I have tested, see EA optimisation in-sample vs out-of-sample and optimised vs default settings.
What setup should you use, then?
- Keep 12/26/9. It was not the best cell anywhere, but it gave the only two cells that were clearly positive in both halves. No setting held up on more than one chart.
- If you add one filter, make it the 200 EMA. It was in 10 of the 18 profitable cells. It did not make EURUSD profitable on any setting.
- Do not trust the zero line alone. Textbook side or trend side on its own made money in 6 of 48 cells, all on gold M15 or EURUSD M15 slow settings.
- Use M15 or slower. No combination made money on M5 on either market. The cost per trade is the same while the moves are smaller; the arithmetic is in spread and swap costs in MT4.
- Do not optimise MACD on a few weeks of data. The first-half winner ranked 30th, 10th, 17th and 28th of 30 afterwards.
Frequently asked questions
How do I add a zero line to MACD in MT4?
Open the MACD properties, go to the Levels tab, click Add and set the value to 0. The histogram already grows from zero; the level just draws the line.
What are the best MACD settings with a zero-line filter?
On this data, 12/26/9 with a 200 EMA on gold M15: +$1.21 an ounce alone and +$2.17 with the trend-side cross, both positive in both halves. Nothing made money on EURUSD M5 or gold M5.
Is MT4 MACD the same as the textbook MACD?
The MACD line is the same. MT4 and MT5 smooth the signal line with a simple average instead of an exponential one, so crosses come at slightly different bars.
Should I use the 200 EMA with MACD?
It was in 10 of 18 profitable cells, the most of any filter, but all of them were on gold or slow EURUSD M15 settings. It did not rescue any EURUSD M5 setting.
Can I optimise MACD settings in the Strategy Tester?
You can, but on this data the best first-half setting never stayed profitable in the second half and ranked 30th of 30 on EURUSD M5.
Want one clean trend tool instead of three stacked filters?
It is my own enhanced DeMARK Trend Line indicator for MetaTrader 4 and 5. Non repaint, clean, and free.

