GlossaryMACD (Moving Average Convergence Divergence)

MACD (Moving Average Convergence Divergence)

The MACD (Moving Average Convergence Divergence) shows the distance between a fast and a slow exponential moving average of the close. It combines trend direction and momentum: when the distance grows, the move is accelerating; when it shrinks, the move is fading.

Calculation

CtC_t is the close, ff the length of the Fast EMA, ss that of the Slow EMA and mm the Signal smoothing.

EMA. Each exponential moving average starts with the simple mean of its first nn input values and then continues recursively:

EMAt(n)=α xt+(1−α) EMAt−1(n),α=2n+1\mathrm{EMA}^{(n)}_t = \alpha\,x_t + (1-\alpha)\,\mathrm{EMA}^{(n)}_{t-1}, \qquad \alpha = \frac{2}{n+1}

MACD line (blue):

MACDt=EMAt(f)(C)−EMAt(s)(C)\mathrm{MACD}_t = \mathrm{EMA}^{(f)}_t(C) - \mathrm{EMA}^{(s)}_t(C)

It begins only once both averages exist, that is, from candle ss.

Signal line (orange), an EMA of the MACD line, not of the price:

Signalt=EMAt(m)(MACD)\mathrm{Signal}_t = \mathrm{EMA}^{(m)}_t(\mathrm{MACD})

Its starting value is the mean of the first mm MACD values. It therefore begins from candle s+m−1s + m - 1, from candle 34 with the default settings.

Histogram (columns):

Histt=MACDt−Signalt\mathrm{Hist}_t = \mathrm{MACD}_t - \mathrm{Signal}_t

How to read it

The lines

  • Zero line: Above zero, the fast EMA is above the slow one and the price is rising over this horizon. A move above or below zero is exactly the crossover of the two EMAs.
  • Signal crossover: If the MACD line crosses the signal line upward, momentum turns up; downward, it turns down.
  • Divergences: A new price high with a lower MACD high shows fading momentum, and the mirror image applies at a low.

The histogram

Each column is compared with the previous one. This gives four colors:

ColumnColorMeaning
above zero, higher than the previous onestrong greenMACD above signal, distance growing
above zero, lower than the previous onelight greenMACD above signal, distance shrinking
below zero, lower than the previous onestrong redMACD below signal, distance growing
below zero, higher than the previous onelight redMACD below signal, distance shrinking

The color change comes before the crossover: when the columns shrink, the lines are already converging.

Note The columns have their own scale. They are stretched together so that the largest visible column fills about 60% of the space next to the zero line; otherwise they would be hard to see beside the lines. Their height therefore can't be read from the scale, but they can be compared with each other. The legend shows the real value.

Settings

SettingDefaultEffect
Fast EMA12Length ff of the fast average (2–50).
Slow EMA26Length ss of the slow average (2–100).
Signal smoothing9Length mm of the EMA over the MACD line (2–50).

The settings don't check whether the fast EMA is shorter than the slow one. If you set it longer, the sign of the MACD flips.

Limitations

  • The MACD is a distance in price units. Its height is not comparable across symbols and price levels; what counts are direction, crossovers and divergences.
  • Both lines lag the price. In sideways phases they often cross without a trend following.

Related indicators