Indicators · Momentum

MACD

The MACD (Moving Average Convergence Divergence), created by Gerald Appel, is the difference between a fast and a slow exponential moving average. With its signal line and histogram, it shows the direction of the trend and the acceleration or deceleration of momentum.

What it's for
  • Follow the direction of the trend and its momentum with two exponential averages.
  • Time changes of momentum with signal-line and zero-line crossovers.
  • Spot divergences between price and momentum.
Pane
Separate, around zero
Plan
Every plan
Settings
Fast, slow, signal lengths, source
Default
12, 26, 9 on the close

Calculation

MACD line  = EMA(close, 12) − EMA(close, 26)
signal     = EMA(MACD line, 9)
histogram  = MACD line − signal

The histogram is bright when it grows away from zero and faded when it shrinks back toward zero, as on TradingView.

  • MACD above zero: the 12-period EMA is above the 26-period EMA, the short-term trend is up.
  • MACD above its signal (histogram positive): momentum is improving.
  • Histogram shrinking: momentum is fading, often before the MACD crosses its signal.

Crossovers and the zero line

MACD crossing above its signal near the low, then above zero, then a bearish signal cross after the top
Near the low the MACD crosses above its signal (momentum improves), then above zero (the 12 EMA crosses above the 26 EMA, the trend turns up). After the top, a bearish signal cross warns that momentum is fading.

Signal-line crossovers are early but frequent; zero-line crossovers are later but describe a trend change. Many traders take signal crossovers only in the direction of the zero-line side (buy crosses above zero, sell crosses below it).

Case study: a bearish divergence

Price makes a higher high while the MACD makes a lower high, followed by a decline
Price makes a slightly higher high, but the MACD's second peak is much lower than the first: the advance has lost momentum. The decline that follows breaks the previous swing low.

Limits

  • The MACD is made of moving averages and inherits their lag and their whipsaws in ranges.
  • Its values are in price units: they cannot be compared between assets or between very different price levels of the same asset.
  • It needs about 34 bars of data before the signal line exists (26 for the slow EMA plus 9 for the signal).

Charts in this guide use simulated prices generated for illustration; levels and outcomes shown are examples, not observations of a real market. Educational content only, not investment advice.