Definition
MACD is a trend and momentum indicator, created by Gerald Appel, that subtracts a longer exponential moving average from a shorter one and compares the result with its own smoothed signal line. Its default form uses 12-, 26- and 9-period settings.
How it works
The MACD line is the 12-period EMA of price minus the 26-period EMA, so it is positive when the faster average sits above the slower one. The signal line is a 9-period EMA of the MACD line, and the histogram is MACD minus signal, showing whether the gap is widening or narrowing.
A MACD line crossing above its signal line, or above zero, describes strengthening upward momentum; the reverse describes weakening. Because MACD is measured in price units, its values cannot be compared directly between a HK$20 share and a HK$500 share.
Formula / convention
MACD = EMA(12) of Close − EMA(26) of Close; Signal = EMA(9) of MACD; Histogram = MACD − Signal
Illustrative example
Illustrative: if a fictional share's 12-period EMA is 52.40 and its 26-period EMA is 51.10, then MACD = 52.40 − 51.10 = 1.30. With the signal line at 1.10, the histogram is 1.30 − 1.10 = +0.20, meaning the MACD line currently sits above its signal line.
What to watch for
MACD is built from moving averages, so it lags and tends to give frequent, contradictory crossovers when price moves sideways. Divergences between price and MACD are subjective to identify, and the default settings are not optimal for every market or time frame.