Moving averages are some of most simple technical indicators investors use. While their simplicity makes them very popular, they do suffer from one drawback—they are trend-following indicators that work best during strong trending periods. During sideways or choppy markets, moving averages tend to generate false signals and are prone to “whipsaws,” where buy or sell signals are reversed in a short time.
To overcome this, technicians use an indicator called the oscillator, which is more sensitive, and thus more responsive, to this kind of market activity. Oscillators may be used to determine overbought or oversold conditions as well as whether there is a divergence between price and the indicator.
One indicator combines the trend-following characteristics of moving averages with oscillator characteristics that help indicate whether a security is overbought or oversold and help pinpoint possible divergences. The indicator is called moving average convergence-divergence, or MACD.
Developed by Gerald Appel in the late1970s, MACD turns two trend-following moving averages into a momentum oscillator by deducting the longer-period moving average from the shorter-period one. Specifically, the MACD is commonly calculated as follows:
MACD Line = 12-day EMA – 26-day EMA
Signal Line = 9-day EMA of MACD Line
MACD Histogram = MACD Line – Signal Line
The MACD line is the 12-day exponential moving average Spreadsheet Corner article from the Third Quarter 2010 issue of CI, available at www.computerizedinvesting.com.less the 26-day EMA. Typically closing prices are used. Exponential moving averages are similar to simple moving averages, except that more weight is given to the latest data. As a result, this type of moving average reacts faster to recent price changes than a simple moving average. For more information on exponential moving averages, see the
The signal line is a nine-day EMA of the MACD line and is plotted along with the MACD line on a chart. It is the interaction between these two lines—crossovers and divergences—that traders look for.
Lastly, the MACD histogram measures the difference between the MACD line and the signal line. It is positive when the MACD line is above the signal line and negative when the signal line is above the MACD Line.
The 12-, 26- and nine-day settings are the typical settings used for the MACD. However, you can adjust the lengths to fit your trading style. Furthermore, you can use the MACD with daily, weekly or monthly charts.
As implied by its name, the MACD is concerned with the convergence and divergence of the two exponential moving averages. Convergences occur when the two lines move toward each other, while divergences take place when the two moving averages move away from each other. The MACD line oscillates above and below the “zero” line or centerline. The MACD is above the centerline whenever the 12-day EMA is above the 26-day EMA. Crossovers above or below the centerline take place when the 12- and 26-day EMAs cross. A rising MACD line means the 12-day EMA is diverging further from the 26-day EMA, which indicates rising upside momentum. The MACD falls as the 12-day EMA diverges further below the 26-day EMA. This indicates that downside momentum is increasing.
The yellow shaded area depicts when the MACD line is negative, or when the 12-day EMA is below the 26-day EMA. The MACD line became negative in September 2011, as indicated by the black “cross” arrow in the lower pane. As the 12-day EMA fell further below the 26-day EMA, the MACD line fell deeper into negative territory. In October 2011, the 12-day EMA rose above the 26-day EMA, which resulted in the crossover of the MACD line into positive territory (the orange shaded area).
In this installment of Technically Speaking, we began a discussion of the moving average convergence-divergence indicator. It takes a simple trend-following indicator—the moving average—and turns it into a momentum oscillator.
In the 2012 Third Quarter issue of Computerized Investing, we will expand on this discussion to cover how traders might use the MACD.