Definition
MACD (moving average convergence divergence) is a trend and momentum indicator built from two exponential moving averages. The MACD line is the 12-period EMA minus the 26-period EMA, and a 9-period EMA of that line is the signal line.
How it works
MACD line = 12-period EMA − 26-period EMA. Signal line = 9-period EMA of the MACD line. Histogram = MACD line − signal line. The values 12, 26 and 9 are conventional settings and can be changed. When the faster average is above the slower one the MACD line is positive, and the gap grows when prices rise faster. Gerald Appel developed the indicator in the late 1970s.
Chart readers look at three things. A signal line crossover occurs when the MACD line crosses its signal line, a centerline crossover when it crosses zero, and a divergence when price makes a new high or low that the MACD does not confirm. Guides describe a cross from below to above as bullish and the reverse as bearish. These describe how the indicator is read and do not predict what price will do.
MACD is built from moving averages, so it lags price. It can also give false signals, especially in sideways markets where the lines cross back and forth, an effect often called whipsaw. The result depends on the chosen periods and on the chart timeframe, so daily and weekly charts can look different. Many chart readers use it together with other indicators and with price levels.
Example (hypothetical numbers)
Suppose a stock's 12-day EMA is 52.40 and its 26-day EMA is 51.10. MACD = 52.40 − 51.10 = 1.30.
If the 9-day EMA of the MACD line is 1.10, the histogram = 1.30 − 1.10 = 0.20, a positive value.
The smoothing factor of an n-day EMA is 2 ÷ (n + 1): 2 ÷ 13 ≈ 0.1538 for 12 days, 2 ÷ 27 ≈ 0.0741 for 26 days and 2 ÷ 10 = 0.20 for 9 days.
A new close of 54.00 lifts the 12-day EMA to 52.40 + 0.1538 × (54.00 − 52.40) ≈ 52.65 and the 26-day EMA to 51.10 + 0.0741 × (54.00 − 51.10) ≈ 51.31, so MACD ≈ 1.33.
Common mistakes
- Treating a signal line crossover as a guaranteed buy or sell signal.
- Using MACD in a sideways market without noticing that the lines keep crossing and giving false signals.
- Forgetting that the periods and the timeframe change what the indicator shows.
This glossary is for education only and is not investment advice. Examples use hypothetical numbers.