Technical analysis
MACD Explained: The MACD Line, the Signal Line and the Histogram
How MACD is built from two EMAs, what the signal line and histogram add, the three crossovers traders watch, and the cases where MACD misleads.
Updated · 3 min read
What MACD is
Moving average convergence divergence is a momentum indicator built entirely from exponential moving averages. Gerald Appel introduced it in the 1970s; Thomas Aspray added the histogram in 1986. The standard settings are 12, 26 and 9, and almost every chart uses them.
Three lines are drawn:
- The MACD line is the 12-period EMA of price minus the 26-period EMA:
MACD = EMA(12) − EMA(26). When the fast average is above the slow one, MACD is positive; the further apart they are, the larger it is. - The signal line is a 9-period EMA of the MACD line itself:
Signal = EMA(9) of MACD. It is MACD smoothed once more. - The histogram is the gap between them:
Histogram = MACD − Signal. It is drawn as bars above and below zero.
MACD is measured in price units. A MACD reading of 2.5 on a stock trading at 50 is a large gap between the averages; the same reading on an index at 5,000 is nothing. The indicator cannot be compared across instruments, and a chart that shows it on the same scale over years of rising prices will make recent swings look larger than old ones. The percentage price oscillator, which divides the difference by the slow EMA, exists to fix that.
The three signals
A signal-line crossover is the MACD line crossing the signal line. Crossing upward means the gap between the averages is widening in favour of the fast one, which is momentum picking up; crossing downward is momentum fading. These are the most frequent MACD signals and, in a sideways market, the least reliable.
A zero-line crossover is the MACD line crossing zero, which is the same event as the 12 EMA crossing the 26 EMA on the price chart. It is a slower, trend-level signal: above zero the fast average leads the slow one and the trend is up.
The histogram is read for its shape rather than its crossings. Bars shrinking towards zero while price keeps rising mean each new high is being made with less momentum than the last, which often precedes the signal-line crossover by several bars. Bars growing away from zero mean the move is accelerating.
| Event | What it says | Typical lag |
|---|---|---|
| Histogram peaks and shrinks | Momentum of the current leg is fading | Earliest |
| MACD crosses signal line | Momentum has turned | Early |
| MACD crosses zero | The 12 EMA has crossed the 26 EMA | Late |
Divergence
As with RSI, divergence between price and MACD is the reading most traders are looking for. A higher high in price with a lower high in MACD says the second advance opened a smaller gap between the averages than the first: the trend has lost pace. The reverse at lows is bullish divergence. MACD divergences take longer to build than RSI divergences because every input is already a moving average, and they are correspondingly rarer and slower to resolve.
Where MACD misleads
MACD is a trend indicator dressed as an oscillator. It has no upper or lower bound, so there is no overbought level, and in a range the lines cross repeatedly with nothing to show for it. It is also entirely lagging: every component is an average of averages, and on a daily chart the signal-line crossover typically prints several sessions after the turn in price.
The settings matter less than most discussion suggests, but one thing about them does: 12, 26 and 9 were chosen for daily charts. On a weekly chart the same numbers summarise half a year of data; on a five-minute chart, a couple of hours. The indicator behaves the same way at every scale, but what counts as a trend does not.
On the desk
The symbol pages draw MACD with its signal line and histogram in a pane under the candles, with the same 12, 26 and 9 settings on every timeframe, so a histogram that is shrinking on the daily chart can be checked against the four-hour one.
Questions
- What are the MACD settings 12, 26, 9?
- 12 and 26 are the periods of the two exponential moving averages whose difference is the MACD line. 9 is the period of the EMA of the MACD line that forms the signal line. The histogram is the difference between the MACD line and the signal line.
- What does a MACD crossover mean?
- A signal-line crossover is the MACD line crossing its 9-period signal line and marks momentum turning. A zero-line crossover is the MACD line crossing zero, which is the same event as the 12 EMA crossing the 26 EMA on the price chart and marks the trend turning.
- Is MACD a leading or a lagging indicator?
- Lagging. Every part of it is a moving average, so it confirms turns after they have begun. The histogram, which shows the gap between the MACD and signal lines, shrinks before the lines cross and is the earliest of its readings.
- Can MACD be compared between two stocks?
- No. MACD is measured in the instrument's own price units, so a reading of 2 means something different on a stock at 40 and on an index at 4,000. The percentage price oscillator divides the difference by the slow EMA and can be compared across instruments.
Related guides
Technical analysis
EMA 50 and EMA 200
How the 50 and 200 exponential moving averages are calculated, what a golden cross and a death cross mean, and how an EMA touch is read across timeframes.
5 min read
Technical analysis
RSI explained
The relative strength index step by step: Wilder's formula, what 70 and 30 mean, why RSI stays overbought in a trend, and how divergence is read.
4 min read
Technical analysis
Bollinger Bands
How Bollinger Bands are built from a 20-period average and two standard deviations, what %B and bandwidth measure, and how the squeeze and band walks are read.
3 min read