The first article of Filtering the Noise dealt with smoothing the data with moving averages. Here I want to discuss a really popular concept popularized by an indicator called Moving Average Convergence Divergence or MACD. MACD is a concept using two exponential averages developed by Gerald Appel. It was originally developed as the difference between the 12 and 26 day exponential averages; the same as a moving average crossover system with the periods of the two averages being 12 and 26. The resulting difference, called the MACD line, is then smoothed with a nine-day exponential average, which is referred to as the signal line. Gerald Appel originally designed this indicator using different parameters for buy and sell signals, but that seems to have faded away and almost everyone now uses the 12–26–9 combination for both buy and sell.
The movement of the MACD line is the measurement of the difference between the two moving averages. When MACD is at its highest point, it just means that the two averages are at their greatest distance apart (with short above long). And when the MACD is at its lowest level, it just means the two averages are at their greatest distance apart when the short average is below the long average. It really is a simple concept and is a wonderful example of the benefit of charting, because it is so easy to see. MACD, and in particular, the concept behind it, is an excellent technical indicator for trend determination. Not only that, but it also shows some information that can be used to determine overbought and oversold, as well as divergence. You could say it does almost everything. Chart A shows the MACD with the S&P 500 Index above. The dark line is the 12–26 MACD line and the gold line is the nine-period average of the dark line. The red indicator at the bottom is just an expanded view of the histogram which is the difference between the dark line and the gold line.
I drew blue lines to show that whenever the two moving averages (dark and gold) cross, the histogram moves above and below its zero line. I intentionally used the most recent S&P data because I absolutely think it is horrible when someone is selling you something and they hand-select the period of data. That is certainly fine for educational purposes, but that’s it. It should be obvious that there are some whipsaws using MACD. I hope that does not come as a surprise to you. Note: the red histogram is the same as the gray one, I just wanted to show it with a larger chart. Incidentally, if you are ever analyzing the relationship between to lines (moving averages or whatever) a histogram of the difference between them will be decisive and easier to see.
Chart A
Please keep this in mind: Although MACD is a valuable indicator for trend analysis, it is only the difference between two exponential moving averages. In fact, if you used price and one moving average it would be similar in that one of the moving averages was using a period of one. This is not rocket science!
I wrote an article for Stocks and Commodities magazine in February 1987 – yes, over 30 years ago. Here is part of it:
For this indicator, you need to identify the short-term cycle for the market you are analyzing. Detrending the data as mentioned earlier will assist you in identifying market lows and finding the dominant short-term cycle. Once the cycle has been identified, select an exponential average equal to one half of the short-term cycle. For the Dow Jones Industrial Average, the short-term cycle is 14 to 15 days. Therefore, you should use seven days for your exponential average. Most software programs allow you to work with periods instead of smoothing constants when dealing with exponential averages. Periods are somewhat easier to grasp than smoothing constants. The reason behind using an average equal to one half of the short-term cycle is to maximize the price movement without smoothing the dominant cycle. Only through years of use and experimentation have I been able to determine the second part of the equation: That is, the length (or period) of the second exponential average used with this trend-following indicator. Simply stated, use a period six times the value of what you used for the short-term average. If you used seven days for the short one, then use 42 days for this one.
The relationship between these two is similar to the Moving Average Convergence Divergence (MACD) first written about by Gerald Appel. Merely subtract the longer period average from the short period average and you are left with an oscillator that will give quicker and more timely signals than your standard two-moving-average crossover system. Buy and sell signals are generated by using an arithmetic moving average on this oscillator. Again, by much testing, I have found that the period for this average should be three times the value of the short-term exponential average. In this example, that would be 21 days. (A)
Well, it still appears to be an improvement to Appel’s original work; or I should say at least in this example. Chart B is the MACD-like indicator using exponential moving averages of 7 and 42, with a smoothing of 21 to get the signal histogram. Those are the same numbers discussed in the aforementioned article. There was a one day whipsaw shown by the red circle. How many times have you seen other non-StockCharts.com analysts ignore these small whipsaws? I guess they hope you won’t notice.
Chart B
In a future article, I’ll explain the concept of identifying the cycle of the market in which I used to calculate a 7-period exponential average. Again, once you know the cycle, use half of that for the first average. Then the second average is always 6 times the first and the signal line is 3 times the first one.
(A) From "Trend of the Trend" by Greg Morris. Technical Analysis of STOCKS & COMMODITIES magazine, Vol. 5, No. 2 (Feb 1987). Copyright © Technical Analysis, Inc. Used with permission.
Dance with the Trend,
Greg Morris