Trend

MACD (Moving Average Convergence Divergence)

MACD line, signal line and histogram explained: crossovers, zero line, divergences and MACD alerts on crypto and stocks.

4 min readUpdated

MACD (Moving Average Convergence Divergence) measures the gap between a fast and a slow moving average. When the fast one pulls away upward, momentum is building; when the two converge, the move is losing steam. Three lines come out of it: the MACD line, its signal line and the histogram between them.

What it measures

  • The MACD line is positive when the fast average is above the slow one, i.e. recent prices are higher than older ones. Its size is the strength of the move, in price units.
  • The signal line is a smoothed MACD: it trails it.
  • The histogram shows whether MACD is pulling away from its own average (momentum accelerating) or coming back to it (momentum fading).

Try it

Watch the histogram: it shrinks before the MACD line turns, an early sign the move is tiring.

PriceMACDSignalHistogramExample market ยท hover to read values
Price, MACD, Signal on an example market: a rise, a sideways range, a sharp drop and a recovery.113.10

How Subtrigger computes it

OutputStream (BTC on Binance)Meaning
macdind:macd_12_26_9_1m@binance.miniticker:BTCUSDT:macdEMA 12 โˆ’ EMA 26
signalind:macd_12_26_9_1m@binance.miniticker:BTCUSDT:signalEMA 9 of MACD
histogramind:macd_12_26_9_1m@binance.miniticker:BTCUSDT:histogramMACD โˆ’ signal

Bars are 1 minute for crypto and 5 minutes for stocks (ind:macd_12_26_9_5m@nasdaq.stocks:NVDA:macd). A first value needs 34 bars (26 for the slow EMA, then 9 for the signal); Subtrigger keeps 105 bars so the values settle.

How to read it

EventCondition in SubtriggerMeaning
Bullish crossmacd > signal, or histogram > 0Momentum turns up
Bearish crossmacd < signal, or histogram < 0Momentum turns down
Zero-line cross upmacd > 0EMA 12 above EMA 26: short-term uptrend
Zero-line cross downmacd < 0Short-term downtrend
Shrinking histogramโ€”The move is fading

Alert ideas

The cleanest MACD alert uses the histogram, because "histogram above 0" is the same as "MACD above signal":

Alert idea

BTCUSDT MACD histogram ยท 1m ยท Binance > 0

Create this alert

A stock entering a short-term uptrend:

Alert idea

NVDA MACD ยท 5m > 0

Create this alert

Common mistakes

  • Treating every cross as a trade. In a flat market MACD and signal braid around each other. Crosses far from zero matter more than crosses near it.
  • Comparing levels across markets. MACD scales with the price.
  • Ignoring the lag. Built from moving averages, MACD confirms; it does not anticipate. The histogram is the earliest of its three lines.

For pros

  • Normalize it. MACD divided by the price (or by ATR) is comparable across markets. Percentage price oscillators do exactly that.
  • Histogram slope. A histogram that is positive but falling for several bars often precedes a signal-line cross; it is the second derivative of the trend.
  • Momentum family. MACD, ROC and RSI all measure momentum. MACD is the smoothest and slowest of the three.
  • EMA: the building block of MACD.
  • RSI: bounded momentum, 0 to 100.
  • ROC: raw momentum in percent.

FAQ

What do 12, 26 and 9 mean?

The periods, in bars, of the fast EMA, the slow EMA and the signal EMA. They are Gerald Appel's original settings and still the most used.

Should I alert on the MACD line or on the histogram?

On the histogram for crosses of the signal (above or below 0), on the MACD line for crosses of zero.

Why does MACD need 34 bars before its first value?

The slow EMA needs 26 bars, and the signal line then needs 9 values of MACD: 26 + 9 โˆ’ 1 = 34.