MACD Indicator Explained: Formula, Signal Line, Histogram and Divergence
Lesson 6 of 10 · Intermediate
MACD structure and formula
MACD (Moving Average Convergence Divergence) was introduced by Gerald Appel in the late 1970s. The core idea is simple: the distance between a fast average and a slow average says something about the momentum of a trend. The standard setting is 12, 26, 9:
- MACD line = EMA(12) − EMA(26) of the close.
- Signal line = EMA(9) of the MACD line itself.
- Histogram = MACD line − signal line.
When the 12 EMA is above the 26 EMA, MACD is positive, and vice versa; a MACD zero-line cross is exactly a crossover of the two exponential averages. The histogram shows the rate of change of MACD itself, so it turns before the crossovers do.
An important point: unlike RSI, MACD has no fixed range, and its value is in price units. On gold, MACD is expressed in dollars, and when price and volatility rise, MACD values get larger too. Comparing today's MACD reading with one from several years ago, or with another market, has no direct meaning, and you cannot define a fixed “overbought” level for it.
Three classic signal types
- Signal line cross. MACD crossing above the signal line suggests short-term bullish momentum, and the reverse for bearish. This is the most frequent and noisiest signal.
- Zero-line cross. It shows that the fast average has crossed the slow one; slower, but usually more meaningful than a signal cross. A signal cross that happens above zero and in the direction of the trend fits the broader context better than one against it.
- Divergence. Price makes a higher high while MACD or the histogram makes a lower high. The logic is like RSI divergence and it carries the same limitation: it is a warning, not an order.
The difference between MACD and RSI is that MACD is more trend-sensitive and in long trends stays above or below zero, while RSI can get stuck in an extreme zone for a long time. On the other hand, because it has a fixed range, RSI is better suited for gauging momentum extremes.
Reading the histogram
The histogram is the distance between MACD and its signal line. When the bars grow taller, momentum is accelerating; when they shrink, momentum is fading, although direction has not yet changed. Many analysts treat a shrinking histogram as the first sign of fatigue, because a signal line cross happens exactly when the histogram reaches zero.
But in a strong trend, a shrinking histogram may be only a pause before the bars grow again. The histogram measures momentum; it does not forecast reversals. A useful exercise is to mark phases on a past gold chart where the histogram shrank but the trend continued, and phases where the shrinking led to a real pullback, then look at how price structure differed in the two cases.
Hypothetical gold example
The numbers are hypothetical. Gold rallies from 3840 to 3900 on the 1-hour chart and MACD reaches about 9 dollars. On the next push, price reaches 3908 but MACD only gets to 6, and the histogram at the second peak is clearly shorter. This divergence shows that the pace of the rise has slowed. At the same time, price is still above the 50 EMA and MACD is above zero, so the broader context is still bullish.
A balanced reading is: Short-term momentum has weakened; if MACD drops below zero and price breaks the latest higher low, the probability of a deeper pullback rises. That is a conditional scenario, not a suggestion to sell.
Lag, ranges and settings
MACD is built from moving averages and inherits all their limitations. In a range, MACD oscillates around zero and produces repeated, fruitless crosses. In very sharp moves, the cross usually appears after a large part of the move has happened. One more practical point: if your chart has both a 12/26 EMA crossover and MACD, you are seeing the same information twice.
Some traders experiment with other settings such as 8, 17, 9 or 5, 35, 5. Faster settings reduce lag and increase noise. Test any change on enough data and beware of overfitting: a setting that looked great over the last six months of gold will not necessarily behave the same way in the next six.
MACD in multi-timeframe analysis
One sensible use of MACD is to align two timeframes. For example, the 4-hour MACD can provide the momentum backdrop: above zero means medium-term momentum is positive, below zero means negative. Then on the 1-hour or 15-minute chart you only pay attention to signs that agree with that backdrop. This reduces the number of decisions and stops you chasing every small cross.
The filter has a cost, though: at turning points the higher-timeframe backdrop changes late, and part of the new move is missed. Also, if both timeframes are derived from the same data and the same formula, their agreement is not fully independent. Treat MACD as one layer of evidence, not a complete decision system.
Common mistakes
- Comparing MACD numeric values across different periods or different symbols.
- Acting on every signal line cross, especially in a ranging market.
- Using MACD to define a fixed overbought or oversold level.
- Running MACD alongside a 12/26 EMA crossover and treating them as two independent confirmations.
- Changing the settings based on a few recent examples without testing.
What does volume say here?
The MACD histogram measures the acceleration of price, while delta measures the acceleration of market-order pressure. Comparing them clarifies the quality of a move. When the histogram grows during a rally and the candle deltas are positive and rising, the move is supported both by price and by participation. But if the histogram grows while delta is flat or negative, the rise may be driven more by sellers stepping back and thin liquidity in the order book than by real buying; such a move is more fragile.
For crosses you can also ask: did the bullish MACD cross happen where price was defending a high volume node (HVN) or VWAP, or in the middle of a low-volume zone that price usually crosses quickly? The location of the cross relative to volume structure often says more than the cross itself. Still, delta has noise too and can mislead at the moment of news releases; the goal is to line up independent pieces of evidence. For gold, delta and volume come from COMEX GC futures converted with the basis, not from CFD tick volume.
📊 See real gold futures volume behind these ideas: free order flow course · today's gold volume map
Frequently asked questions
What is the difference between MACD and RSI?
MACD is built from the difference of two exponential averages, has no fixed range and is more trend-sensitive. RSI runs between 0 and 100 and is better for gauging momentum extremes. Both come from closing prices and overlap to some degree.
Which MACD signal matters most?
It depends on the purpose. A zero-line cross is slower and more meaningful for regime identification; a signal line cross is faster and noisier; the histogram shows changes in acceleration. None is enough without price-structure context.
Is the 12, 26, 9 setting right for gold?
It is the standard, widely used setting and a good starting point. Other settings are used too, but no setting's superiority can be claimed without testing on enough data and different market periods.
Education only, not a recommendation to buy or sell; we never give signals. Price examples are illustrative. Test any method on a demo account first, with strict risk management.