MACD Formula
The most popular formula for the “standard” MACD is the difference between a security’s 26-day and 12-day Exponential Moving Averages (EMAs). Using shorter moving averages will produce a quicker, more responsive indicator, while using longer moving averages will produce a slower indicator, less prone to whipsaws.
Of the two moving averages that make up MACD, the 12-day EMA is the faster and the 26-day EMA is the slower. Closing prices are used to form the moving averages. Usually, a 9-day EMA of MACD is plotted along side to act as a trigger line.
A bullish crossover occurs when MACD moves above its 9-day EMA, and a bearish crossover occurs when MACD moves below its 9-day EMA.
The Merrill Lynch (MER) chart below shows the 12-day EMA (thin blue line) with the 26-day EMA (thin red line) overlaid the price plot. MACD appears in the box below as the thick black line and its 9-day EMA is the thin blue line. The histogram represents the difference between MACD and its 9-day EMA. The histogram is positive when MACD is above its 9-day EMA and negative when MACD is below its 9-day EMA.
