S&P 5007,659▼ 1.09%Nasdaq26,140▼ 2.15%Dow Jones52,002▼ 0.34%Nasdaq 10029,188▼ 2.50%VIX19.99▲ 21.45%US Dollar101.84▼ 0.21%Gold (GLD)382.01▼ 0.18%Oil (USO)161.76▲ 2.83%

MACD explained: signal line, histogram and crossovers

18 October 20264 min readFinancial knowledge · lesson 95
MACD explained: signal line, histogram and crossovers

MACD, short for moving average convergence divergence, is a trend and momentum indicator built from the gap between two exponential moving averages. It was developed by Gerald Appel in the late 1970s. Its main job is to show whether a stock's momentum is strengthening or weakening, and it does so with three plotted elements: the MACD line, a signal line and a histogram.

The formulas

MACD line   = EMA(12) of closing price - EMA(26) of closing price
Signal line = EMA(9) of the MACD line
Histogram   = MACD line - Signal line

The numbers 12, 26 and 9 are the standard settings on a daily chart. Each EMA is an exponential moving average, which gives extra weight to recent prices.

Here is how the pieces behave:

  • The MACD line is positive when the 12-period average is above the 26-period average. That means recent prices are higher than slightly older prices, which is consistent with upward momentum. It is negative when the reverse is true.
  • The signal line is a smoothed version of the MACD line. It reacts more slowly, so the MACD line crosses it when momentum changes direction.
  • The histogram shows the distance between the two lines. It is above zero when MACD is above its signal line and below zero when it is below.

Example (illustrative numbers)

Assume the 12-period average is 52.0 and the 26-period average is 50.0, so the MACD line is 2.0. The signal line starts at 1.50. The signal line updates with the standard 9-period weighting, which is 20% of the new MACD value and 80% of the previous signal value.

Day MACD line Signal line Histogram Reading
A 2.00 1.50 +0.50 MACD above its signal
B 1.80 1.56 +0.24 Gap shrinking, momentum slowing
C 1.50 1.55 -0.05 MACD crosses below its signal

On day C, the MACD line is still positive, meaning the 12-period average remains above the 26-period average, so the longer trend has not turned down. But the crossover below the signal line says upward momentum has weakened. The histogram showed this one day earlier by shrinking toward zero.

How to read MACD

  • Signal line crossovers. MACD crossing above the signal line is the conventional bullish crossover; crossing below is the bearish one. The histogram flips sign on the same day.
  • Zero-line crossovers. MACD crossing above zero means the fast average has moved above the slow one, which is the same idea as a moving average crossover. See golden cross and death cross for the classic version with 50- and 200-day averages.
  • Histogram shape. A histogram that is growing means momentum in that direction is increasing. A histogram shrinking toward zero often appears before a crossover, as in the example above.
  • Divergence. If price makes a new high but MACD makes a lower high, momentum may be fading. The same idea applies to RSI, discussed in RSI divergence.

Rule of thumb: crossovers that agree with the direction of the larger trend are generally treated as more reliable than crossovers that go against it, and crossovers on weekly charts as more significant than those on daily charts.

Common mistakes and limits

  • The scale is not comparable. MACD is measured in price units. A MACD reading of 2.0 means something different for a $20 stock and a $400 stock, and different for the same stock at different price levels. Compare shapes and crossovers, not raw levels, or use the percentage form some platforms offer.
  • Lag. Both inputs are moving averages, so MACD confirms momentum changes after they begin. The histogram is the earliest part of the display, but even it reacts to past prices.
  • Whipsaws. In a sideways market the MACD line crosses the signal line repeatedly, creating many signals with little follow-through.
  • Default settings are conventions. Shorter settings react faster and give more false signals; longer settings are steadier but later. Nothing makes 12/26/9 optimal for every stock or time frame.
  • Using it as a standalone system. A crossover is one momentum observation. It says nothing about valuation, earnings quality or upcoming events.

MACD overlaps with other momentum tools. The RSI and the stochastic oscillator measure momentum in different ways and can disagree with MACD, which is useful to notice but also a reminder that stacking similar indicators adds little new information.

Where to see it on StocksXray

The scanner has a MACD cross preset that lists stocks showing a crossover. As with any preset, open the chart and check whether the crossover is clean or one of several recent back-and-forth crossings. The technical summary on each stock page covers daily, weekly and monthly time frames, and a crossover on a longer time frame generally carries more weight.

Key takeaways

  • MACD = EMA(12) - EMA(26); the signal line is a 9-period EMA of MACD; the histogram is the difference between the two.
  • Crossovers of the signal line and the zero line are the most common signals, and both lag.
  • A shrinking histogram can show momentum fading before a crossover appears.
  • MACD values are in price units, so compare patterns rather than absolute levels across stocks.
  • In sideways markets, crossovers generate frequent false signals.

Related reading

Educational only, not financial advice. Examples use illustrative numbers.