Technical indicator

MACD (Moving Average Convergence Divergence)

MACD measures the difference between a fast and a slow moving average and compares it with its own average, the signal line. It shows both the direction and the momentum of a trend.

Type
Trend / momentum
Typical parameters
12, 26, 9
Main signal
MACD crosses above (buy) or below (sell) its signal line

Components

  • MACD line: the 12-day moving average of the closing price minus the 26-day moving average.
  • Signal line: a 9-day moving average of the MACD line.
  • Histogram (convergence–divergence): the MACD line minus the signal line.

Calculation

MACD=EMA12−EMA26
Signal=EMA9(MACD)
Histogram=MACD−Signal

The standard definition uses exponential moving averages; some charting programs use simple moving averages instead, which gives a slightly slower indicator. The 12, 26 and 9 periods are the conventional settings and can be changed.

Trading signals

  • Buy when the MACD line rises above the signal line – the histogram turns positive.
  • Sell when the MACD line falls below the signal line – the histogram turns negative.
  • Zero-line crossings: MACD above zero means the 12-day average is above the 26-day average, confirming an uptrend.
  • Divergence: when the price makes a new high but MACD makes a lower high, upward momentum is fading.

Technical indicators describe past prices and do not guarantee future results. Combine several indicators and test a strategy on historical data before trading it. See our disclaimer.