---
type: "Lesson"
title: "MACD (moving average convergence divergence)"
description: "MACD (moving average convergence divergence) measures the gap between a fast and a slow exponential moving average of price, to show how momentum is changing."
tags: ["macd","moving average convergence divergence","signal line","histogram","12 26 9","momentum","appel"]
sources: [{"id":"s1","resource":"https://en.wikipedia.org/wiki/MACD"}]
generated: {"by":"process:eqdoc-okf-export","at":"2026-10-25"}
stale_after: "2027-04-25"
x-eqdoc-id: "ta-macd"
x-eqdoc-reviewed-at: "2026-10-25"
x-eqdoc-questions: ["What is MACD?","How do I read the MACD histogram?","What is the MACD signal line?","Explain MACD 12 26 9"]
x-eqdoc-licence-note: "Written by eqdoc in its own words; facts checked against the CC BY-SA page listed"
---

MACD (moving average convergence divergence) measures the gap between a fast and a slow exponential moving average of price, to show how momentum is changing.

- **How it is built.** It has three parts, all from closing prices, with the standard settings 12, 26 and 9.
  `MACD line = EMA(12) - EMA(26)`
  `Signal line = EMA(9) of the MACD line`
  `Histogram = MACD line - signal line`
  The idea is credited to Gerald Appel; the histogram was added later. The TA-Lib function is `MACD`.
- **The zero line.** When the MACD line is above zero, the 12-day EMA is above the 26-day EMA: recent prices have been higher than the slightly longer average. Below zero means the reverse.
- **Crossovers.** Analysts note when the MACD line crosses its signal line. A cross above is conventionally read as momentum turning up; a cross below as momentum turning down. These describe what has already happened to the averages, not what the price will do next.
- **The histogram.** Bars growing taller show the gap between line and signal widening; shrinking bars show it narrowing. A shrinking histogram is often read as a move losing pace.
- **Divergence.** If price makes a new high but the MACD line makes a lower high, analysts call it a divergence: the latest push came with less momentum. It can persist for a long time and is not a timing tool.
- **Pitfalls.** MACD is built from moving averages, so it lags. In sideways markets crossovers are frequent and often reverse. Its values are in rupees, not a 0 to 100 scale, so a MACD of 5 means very different things on a ₹50 share and a ₹5,000 share; levels cannot be compared across stocks.
- **India note.** Periods count NSE or BSE trading sessions on a daily chart, or bars on an intraday chart. Use split- and bonus-adjusted prices.
