Our journal app is in pre-release. If you notice a problem, please contact us.

Home › Articles › MACD explained: the math, the zero line and the signal line

Article

MACD explained: the math, the zero line and the signal line

You added MACD to your chart, but what do the two lines and the zero line actually show? This article explains how MACD is calculated, what the zero line and signal line mean, and how much they lag, with a chart and simple math. It does not tell you whether to use it as a trade signal.

Published 13 Oct 2026By Kenji Okumura, Representative, Tiltnote (has traded forex)

In short

MACD is a short EMA (12 periods) minus a long EMA (26 periods). When it is positive, the short EMA is above the long one; when negative, below. The signal line is an average of MACD itself.

How MACD is calculated

The MT5 help calculates MACD and its signal line like this.[1]

MACD = EMA (12) of close − EMA (26) of close
Signal = SMA (9) of MACD

An EMA (exponential moving average) gives newer prices more weight (see SMA vs EMA). How the signal line is averaged differs between platforms, and some use an EMA. So with the same settings, the signal line can look slightly different on different platforms.

Some platforms also show MACD as bars (a histogram). Whether the bars show MACD itself or the gap between MACD and its signal line differs by platform, so check your platform's help.

Top: price with 12- and 26-period EMAs. Bottom: MACD (the gap between the two EMAs) and its signal line. Where the two EMAs cross, MACD crosses zero.
A made-up example. Where the two EMAs cross in the top panel (dotted vertical lines), MACD crosses the zero line in the bottom panel.

Crossing zero = the two EMAs crossing

Because MACD is the gap between two EMAs, MACD is zero exactly when the two EMAs are equal. So MACD crossing above zero is the same moment as the 12-period EMA crossing above the 26-period EMA. For more on moving average crosses, see golden cross and death cross.

A cross between MACD and its signal line is where MACD crosses its own average. Both kinds of cross tend to happen several times in a short span when the market moves sideways.

How much it lags

MACD is built from EMAs, so it lags like they do (see why indicators lag). In a straight-line move, the rough lag is about 5.5 bars for the 12-period EMA and about 12.5 bars for the 26-period EMA. The signal line averages MACD over 9 more bars, adding roughly another 4 bars of lag (all from (N − 1) ÷ 2, our own calculation). Roughly, the 26-period EMA moves about 12 bars behind price.

Its size depends on the currency pair

MACD is a price difference, so its size depends on the price level of the pair. A pair quoted around 150 (such as yen pairs) and one quoted around 1 can make similar moves in percentage terms, yet show MACD values of very different sizes. So a rule like "MACD above X is big" does not work across different pairs or timeframes.

Check how you use it (you decide)

This article does not decide whether to use MACD, or which settings or crosses to watch. If you use it, decide these first and log them, so you can see later how it worked for you:

The trading stats calculator turns a profit and loss list into win rate, average P&L and longest losing streak. With few trades, the numbers can swing a lot. For other indicators, see how common indicators work and RSI explained.

Sources

  1. MetaQuotes. MACD (MetaTrader 5 Help). https://www.metatrader5.com/en/terminal/help/indicators/oscillators/macd

Tools for this article

Tag the trades you took on MACD.

Tiltnote is a trading journal you can use free with manual entries. On every trade you can log your strategy name, how you felt, whether you kept your rules, and a note. Put the settings in the strategy name, like "MACD 12/26/9", and you can look back at those trades later.

Try Tiltnote free →Opens the Tiltnote web app. On the free plan, analysis and history show your most recent 14 days (older records are kept and unlock on the paid plan).

More articles

SMA vs EMA: what is the difference?Golden cross and death cross, explainedRSI explained: the math and what "overbought" meansStochastic oscillator explained: %K, %D, and the 80 and 20 linesWhy a backtest can show an edge that isn't thereHow far can you trust your win rate?Articles →

Feedback on this page

Anything missing, unclear, or a tool you would like? Tell us in any language.

Numbers you entered in a tool are not sent. Please do not include account numbers or passwords. Privacy details

This article is general information. It is not investment advice or a recommendation to make any trade.

Updated 20 Oct 2026 · Run by Kenji Okumura, Representative, Tiltnote · About this site