Concept
MACD (Moving Average Convergence Divergence), devised by Gerald Appel, measures — as its name says — how two moving averages come together (converge) and move apart (diverge). Three things are drawn together in the lower pane.
- MACD line (blue): 12-day EMA − 26-day EMA. Above 0 means the short-term average is above the long-term one.
- Signal line (orange): a 9-day EMA of the MACD line — a smoother version of it.
- Histogram (bars): MACD line − signal line. It shows whether the gap between the two lines is widening or narrowing.
How it is calculated
MACDₜ = EMA(12)ₜ − EMA(26)ₜ
Signalₜ = EMA(9) of MACDₜ
Histogramₜ = MACDₜ − Signalₜ
- The EMA is calculated the same way as on the moving average page.
- The MACD line only appears once the 26-day EMA exists, and the signal line 9 days after that (no values for the first 33 days).
- MACD values are in price units (won), so do not compare their size directly between stocks with different prices.
Work through the numbers
Suppose today’s 12-day EMA is ₩10,300, the 26-day EMA is ₩10,100, and the signal up to yesterday was ₩150.
- MACD = 10,300 − 10,100 = +₩200
- The signal is a 9-day EMA, so it moves 2 ÷ (9 + 1) = 0.2 of the way toward the new value: 150 + 0.2 × (200 − 150) = ₩160
- Histogram = 200 − 160 = +₩40
- If MACD slips to ₩190 the next day, signal = 160 + 0.2 × (190 − 160) = ₩166 and histogram = +₩24
On the second day MACD is still above zero and above the signal. The only change is that the histogram shrank from 40 to 24, meaning the gap between the two lines is narrowing. The histogram shows this change in the gap first, but the gap often widens again.
Cautions when reading it
- A moving average of moving averages: MACD passes through moving averages twice, so it reacts late. By the time you see a cross, the price may already have moved a lot.
- Frequent crosses in sideways markets: in directionless stretches the MACD and signal lines cross often. Find such stretches on the chart.
- Crossing zero: MACD above 0 only means the 12-day EMA is above the 26-day EMA; by itself it does not tell you future prices.
- The periods: 12, 26 and 9 are conventional values. Change them and the signal timing changes.
Chart shapes and indicators summarize past prices. The same shape is sometimes right and sometimes wrong depending on the market, and this page does not tell you when to buy or sell any stock. To practice yourself, try the chart lab or mock trading.