Demystifying the MACD
10/20/2011 5:15 pm EST
Real market case studies show how to properly apply the popular MACD indicator in order to generate early warning signals about changing trends in a variety of markets.
Up until 1982, when I officially changed careers, my computerized technical analysis had been accomplished by manually entering data into a spreadsheet program. I left biochemistry to become the Director of Research for a financial firm that had recently acquired computer software called CompuTrac. Many of you are likely not familiar with this software, but even then, it probably had at least 80% of the technical tools that are available on today’s software.
Tim Slater was the driving force behind the project, though ideas were contributed by a number of well-known market technicians, and the programming was done by a computer expert by the name of Jim Schmidt. Over the next 20 years, Tim organized technical analysis group (TAG) seminars around the world and was recognized for his efforts by the International Federation of Technical Analysts.
One of the early studies I found was called convergence/divergence, but is now known to most as the Moving Average Convergence/Divergence (MACD), which was created by Gerald Appel in 1979. At the time, I could not find anyone who was using this indicator.
In 1983, I was able to meet Gerry, as we were both speaking at a TAG conference, and I told him what a great indicator he had developed. He seemed pleasantly surprised at my praise for the MACD, as he had moved on to other methods of analysis.
I explained to him that I was especially impressed by the signals the MACD gave when analyzing weekly currency data, which was a market he did not follow. In the late 1980’s, I had the pleasure of giving a series of seminars in Asia with Gerry and his lovely wife Judith. Let’s take an in-depth look at the indicator Gerry created.
To many, the two lines that make up MACD suggest that a complex algorithm is involved. The two lines are referred to as the MACD and the signal line. The MACD is calculated by simply subtracting a 26-period exponential moving average (EMA) of the closing prices from a 12-period EMA. The signal line is a nine-period exponential moving average of the MACD.
In a strongly trending market, the faster 12-period EMA will be rising or falling more sharply than the 26-period EMA. Conversely, when prices are trading in a range, the difference between the two EMAs will also be range bound. Therefore, the MACD is essentially a momentum oscillator that is derived from multiple moving averages.
The most basic interpretation is to buy when the MACD line crosses above the signal line and sell when it drops below it.
This monthly chart of the SPDR Gold Trust (GLD) is updated through October 18, 2011 and goes back to the beginning of 2008. During that period, the MACD only gave three signals. The MACD line moved above the signal line at the end of September 2007 (line a) and GLD closed the month at $73.51.
At the end of August 2008, the MACD dropped back below the signal line (line b) as GLD closed at $85.07. Over the next 13 months, GLD had several wide swings, dropping as low as $66 and as high as $98.99. At the end of September, with GLD closing at $98.84, the MACD line again moved above the signal line, line c.
This positive momentum signal is still in effect and there is no chance that a new signal will be generated by the end of October. Obviously, for a trader or investor, these signals are probably too slow, as between August 2008 and September 2009, there were some good trading opportunities.
For those doing mutual fund switching, the monthly analysis will catch the major trends, but it is the weekly analysis that I find to be most valuable.
As I worked more with the MACD, I began to focus on a way to anticipate the crossovers. I looked at several different approaches, and at a 1984 TAG conference, I first presented charts that represented the spread between the MACD and signal lines. Two years later, I started calling this indicator the MACD-Histogram, or MACD-His.
I had observed that when the MACD line was above the signal line and the spread was widening, it indicated a strongly uptrending market. But as the trend lost its momentum, the spread narrowed. My analysis indicated that by indentifying divergences in the MACD-His, reliable signals were generated ahead of those from the MACD.
NEXT: Using MACD on the Weekly Time Frame|pagebreak|
This weekly chart of the SPDR Gold Trust (GLD) has the MACD and signal lines, as well as the MACD-His plotted under the price chart. The chart begins in late 2009 as the MACD dropped below the signal line (line a) at the end of December. The MACD-His did not form any divergences prior to the early-December highs.
The MACD declined into April, making a series of lower lows, line 1. The MACD-His, however, made its low in February and then started to rise, diverging from the MACD, line 2. The positive divergence and sharp improvement in the MACD-His in early April suggested a crossover was imminent. Several weeks later, the crossover (line b) did occur.
The MACD-His made its high in May when GLD hit a high of $122.23. GLD edged higher over the next six weeks, making a slightly higher high at $123.56 in June. At the time, the MACD-His was forming lower highs, line 3. Just three weeks later (line c), the MACD dropped below the signal line and GLD subsequently declined from $123.56 to $113.
Then in August, GLD began to edge higher and by the middle of September, line d, the MACD-His turned positive with GLD closing at $124.54. GLD then started to rise more sharply, making a high of $134.85 in October and then a further high at $139.15 in mid-November.
The November highs in GLD were not confirmed by the MACD-His, as it formed lower highs, line 5. It diverged further in December, and while GLD made a new high at $139.54, the MACD-His was much lower. This second strong negative divergence in the MACD-His preceded the sell signal by three weeks, line e.
As I mentioned earlier, much of my initial research was using the MACD-His on the currency markets, which typically trend quite well. This weekly euro futures chart begins in March 2009 with the MACD-His already in positive territory. The MACD-His made an initial high in April and then made a higher high in May when euro futures reached a high of 1.4338.
As the euro continued to climb, the MACD-His was declining, eventually reaching a low in September. The MACD-His turned up in September, forming a secondary high and a negative divergence, line 1.
The euro continued to make new highs, but by the first week in November, the MACD-His had dropped below the September low, confirming the negative divergence, line 1. This occurred three weeks before the sell signal from the MACD, line b, which occurred as the euro was peaking at 1.5142.
The euro then started a seven-month decline, finally making a low in July 2010. While the MACD made lower lows, the MACD-His made its low in February, and by June, it had formed higher lows, line 2, while the euro was forming lower lows. The positive divergence was followed four weeks later by a new buy signal, line c.
The euro rallied into late October, reaching a high of 1.4276, which was a rise of more than 20% from the lows. The MACD-His did confirm the price action, as it made higher highs. Seven weeks after the highs, the MACD- His dropped below the zero line (line d). This signal was short-lived, and just eight weeks later, the MACD-His had moved back above zero line, line e.
This is a pattern that I have frequently observed, as you will see a market make a sharp move against the prior trend that will reverse the signals from the MACD-His. The correction will not violate the key 61.8% support or resistance level before the market again reverses direction.
See related: Fibonacci Analysis: Master the Basics
The euro made its high of 1.4925 the week ending May 7, 2011, but the MACD-His formed a negative divergence, line 3, which warned of a new sell signal. The MACD-His dropped below the zero line four weeks after the euro made its highs.
NEXT: MACD Works on Sectors and Stocks, Too|pagebreak|
The MACD-His will often do a very good job of catching an entire trend. The Select Sector SPDR - Energy (XLE) is a good example. During the summer of 2010, XLE was making lower lows while the MACD-His was forming higher lows, line a. This positive divergence was followed by the MACD-His moving above the zero line in early September, line a.
For those who are followers of candlestick charts, the buy signal coincided with a high-close doji (HCD), a formation first described by John Person. It is discussed in his book Candlestick and Pivot Point Trading Triggers. After learning this from John, I have frequently noticed these formations at key turning points. This was the beginning of a very strong rally, as XLE rose from $53.79 to a high in March 2011 of $80.97, a gain of over 50%.
At the March highs, the MACD-His formed a lower high, line 2, and turned negative the week ending April 23. This was two weeks before XLE reversed to the downside. The weekly on-balance volume (OBV) also formed a negative divergence at the highs. Over the next five months, XLE dropped back to the $55 area.
The MACD-His can also give some very good signals on individual stocks. Valero Energy Corp. (VLO) is a an oil refiner that bottomed in the summer of 2010. As VLO was making a series of lower lows, the MACD-His was forming higher lows, line 3.
When the weekly MACD-His is rising but the prices are making gradual new lows, it is consistent with a bottom formation. Five weeks after VLO made a low of $15.49, line c, the MACD-His crossed the zero line. The MACD-His stayed in a steady uptrend until February 2011, when VLO spiked to a new high at $30.42.
VLO corrected with the overall market in reaction to the Japanese nuclear disaster before again moving to a new high at $30.96. That week, VLO formed a doji candle, and after a marginal new high, VLO dropped sharply, forming a low-close doji, or LCD. The MACD-His formed a negative divergence at the highs and turned negative two weeks later.
From these examples, it should be clear that I find the MACD and the MACD-His to be most valuable when used on the weekly data. They can often give you a very clear reading on the intermediate-term trend. By using the MACD-His, you can look for divergences to give early warnings of a change in the trend.
Using the MACD and the MACD-His can be useful on the daily or intraday data, but in my experience, two different time frames should be used. For example, if you are trading from hourly MACD-His signals, you are likely to have better success by taking just those trades that agree with your daily MACD-His analysis.
Tom Aspray, professional trader and analyst, serves as senior editor for MoneyShow.com. The views expressed here are his own. Readers can post questions or feedback in the comments area below or send to TomAspray@MoneyShow.com.