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.
How Subtrigger computes it
| Output | Stream (BTC on Binance) | Meaning |
|---|---|---|
macd | ind:macd_12_26_9_1m@binance.miniticker:BTCUSDT:macd | EMA 12 โ EMA 26 |
signal | ind:macd_12_26_9_1m@binance.miniticker:BTCUSDT:signal | EMA 9 of MACD |
histogram | ind:macd_12_26_9_1m@binance.miniticker:BTCUSDT:histogram | MACD โ 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
| Event | Condition in Subtrigger | Meaning |
|---|---|---|
| Bullish cross | macd > signal, or histogram > 0 | Momentum turns up |
| Bearish cross | macd < signal, or histogram < 0 | Momentum turns down |
| Zero-line cross up | macd > 0 | EMA 12 above EMA 26: short-term uptrend |
| Zero-line cross down | macd < 0 | Short-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
A stock entering a short-term uptrend:
Alert idea
NVDA MACD ยท 5m > 0
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.
Related
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.
Keep reading
- TrendEMAThe exponential moving average explained: why it reacts faster than the SMA, how to pick a period and which EMA alerts work.
- MomentumRSIRSI explained for beginners and pros: Wilder's formula, overbought and oversold zones, divergences, regimes and RSI alerts.
- MomentumROCRate of change explained: the percent move over N bars, momentum bursts, zero-line crosses and ROC alerts for fast moves.