The MACD: A Combo of Indicators for the Best of Both Worlds

by Wayne A. Thorp, CFA

The MACD: A Combo Of Indicators For The Best Of Both Worlds Splash image

Moving averages are the easiest and most popular technical indicators. But they are trend-following indicators that work best in strong trending periods; in fact, moving average trading systems tend to lose money during periods of choppy trading.

Since markets and individual securities will, at some point, enter a period of sideways or choppy trading where prices move up and down without any sense of direction, you may want to turn to an indicator that is more sensitive and responsive to that kind of trading behavior. Oscillators fit this bill.

Technicians use oscillators in a variety of ways—to determine overbought and oversold conditions, to determine the momentum of a security or index, as well as to identify divergences between price and the indicator.

This article focuses on one indicator that combines the best of both worlds—the trend-following characteristics of moving averages, and oscillator characteristics that help indicate whether a security is overbought or oversold and that help pinpoint potential divergences. The indicator is called moving average convergence/divergence, more commonly known as MACD.

Calculating the macd

The MACD is a trend-following momentum indicator developed by Gerald Appel that shows the relationship between two moving averages of price (normally the close). The MACD line is calculated by taking the difference between a longer-period and shorter-period exponential moving average. It is the interaction of these two moving averages that gives the indicator its name. Over time, the two moving averages are constantly converging and diverging. Exponential averages are used because they respond more quickly to changes in price, since more weight is placed on the most recent price compared to the earlier prices. [For a refresher on the calculation and uses of moving averages, see “An Intro to Moving Averages: Popular Technical Indicators” in the August 1999 AAII Journal]. A “signal” or trigger line is also used, which is the nine-period exponential moving average of the MACD line.

Table 1 illustrates the MACD calculation used here. Two items, however, should be noted:

  • First, you can use any length of period you wish when calculating the various exponential moving averages, although the 12-, 26-, and nine-period averages are most frequently used.
  • Second, a period can be any length you choose—days, weeks, months, etc. In the examples used here, the MACD line is calculated using the 26- and 12-week moving averages, while the signal line is a nine-week moving average of the MACD.


To understand how the MACD can be used in trading, you first need to know how it works.

When the indicator is plotted on a chart, including the MACD line and the signal line, the most important aspect is the interaction between the two lines, as well as their positions relative to the equilibrium, or zero, line.

When the MACD is above the zero line, it indicates that the shorter-period moving average is above the longer-period moving average, which in turn indicates that the market is bullish on this security or index. More accurately, current expectations are more bullish than they were previously—demand is increasing.

When the MACD falls below the zero line, the shorter-period moving average is less than the longer-period moving average, indicating that demand is more bearish than it was in the past.

Figure 1 shows the relationship between the two moving average lines and the MACD for Columbia Energy Group. The top part of the chart contains the weekly price plots for Columbia, as well as a 12- and 26-week exponential moving average. The bottom portion contains the MACD line, the signal line, and the equilibrium, or zero, line. Two things stand out from this chart. First, you can see that as the two moving averages move away from each other, the MACD line rises. Second, you can see that when the two moving averages cross, there is a corresponding crossing of the equilibrium line by the MACD line. The points at which this takes place are shown by the vertical lines on the chart. In the week ending January 22, 1999, the MACD line crossed below the equilibrium line; at the same time, the 12-week exponential moving average crossed below the 26-week average. During the week ending June 4, 1999, the 12-week moving average crossed above the 26-week; at the same time, the MACD line crossed above the equilibrium line.


In general, MACD indicators are used in one of three ways—crossovers, overbought/oversold conditions, or divergences.

Crossovers are probably the most popular use of MACDs: a sell signal is generated when the MACD crosses below the signal line, and a buy signal is generated when the MACD crosses above the signal line.

In addition, the locations of these crossovers in relation to the zero line are helpful in determining buy and sell points. Bullish signals are more significant when the crossing of the MACD line over the signal line takes place below the zero line. Confirmation takes place when both lines cross above the zero line.

SPECIAL OFFER: Get AAII membership FREE for 30 days!
Get full access to, including our market-beating Model Stock Portfolio, currently outperforming the S&P 500 by 4-to-1. Plus 60 stock screens based on the winning strategies of legendary investors like Warren Start your trial now and get immediate access to our market-beating Model Stock Portfolio (beating the S&P 500 4-to-1) plus 60 stock screens based on the strategies of legendary investors like Warren Buffett and Benjamin Graham. PLUS get unbiased investor education with our award-winning AAII Journal, our comprehensive ETF Guide and more – FREE for 30 days

Figure 2. Buy And Sell Signals Generated By MACD Crossovers

Using the MACD in this way makes it a lagging indicator. Just like moving averages—which are also lagging indicators—the MACD works best in strong trending markets. Both the MACD and moving averages are intended to keep you on the “right” side of the market (on the long side during uptrends and on the short side or out of the market altogether during downtrends), meaning you buy and sell late. While you may enter a trade after the beginning of a trend and exit before the trend comes to an end, these indicators are intended to reduce your risk.

Figure 2 shows the buy and sell signals generated for Texas Utilities Company by the crossovers of the MACD line and the signal line. Over the period from June 1997 to August 1999, this system generated five round-trip trades with an average gain of 3.75% per trade. [Note that this system, and all systems used in this article, deal only with long trades.]

The price behavior of Texas Utilities in Figure 2 highlights the strengths and shortcomings of using MACD crossovers in a trading system. First of all, the MACD works very well in strongly trending markets, because it is a trend-following indicator. The first round-trip trade generated a gain of 18.7% over an eight-month period. During this time, Texas Utilities experienced an almost uninterrupted rise in its stock price, which is indicative of a strong uptrend. However the trades generated in July 1998 and again in June and July 1999 came during a period when Texas Utilities’ price was in a period of “choppy” trading. These three round-trip trades all resulted in losses, illustrating the shortcomings of the MACD in non-trending markets.


Another use for the MACD is to determine when a given security or index is either overbought or oversold. An overbought condition may exist when the price has experienced a significant upward move. At some point you expect that the price might fall and return to some more “normal” level. Likewise, when the price has seen an extended downward movement, an oversold condition may exist. At some point the price may be expected to rise to some normal level.

A security or index may be overbought when you see the MACD rise significantly. During this period, the shorter moving average used in the MACD calculation is rising faster than the longer moving average. This is an indication that the price is overextending itself and, at some point, may reverse its course.

When using the MACD to identify periods when a security or index is overbought or oversold, the best buy signals come when the MACD line and the signal line are below the zero line—the security or index may be oversold. Sell signals are generated when the lines are above the zero, where they may indicate an overbought condition.

Unlike other oscillating indicators such as the RSI (relative strength index), there is no pre-determined overbought or oversold condition. High and low MACD levels are relative, depending on the security or index you are examining. You may need to study the behavior of the MACD over time before you can determine when the price is overbought or oversold. Looking at the MACD behavior over an extended period of time, you may be able to discern patterns where the MACD may rise or fall to relatively similar levels, at which point the price will fall or rise, respectively—and with it the MACD lines. You should also be aware that overbought and oversold levels need not be symmetrical for a given security or index (in other words, oversold levels can be higher relative to overbought levels and vice versa).

Although the MACD is a lagging indicator when trading on the crossovers, it is more of a leading indicator when it is used to highlight possible overbought or oversold conditions. A leading indicator is useful because it alerts you to what prices may do in the future. Leading indicators offer the potential of greater rewards—getting in on the ground floor—while exposing you to greater risk—the possibility of the expected move taking place farther off or never taking place at all. There is the assumption that when a security appears to be oversold, its price will rise; conversely, there is the expectation that a price that is overextended or overbought will fall.

Figure 3 is a 10-year weekly chart for Cascade Natural Gas. Examining the behavior of the MACD over this period, you may be able to pick out some recurring patterns in the price and the MACD. The two darker horizontal lines in the MACD window mark the overbought and oversold regions for Cascade. At the top region (overbought) you can see where the stock price frequently experienced a fall shortly after the MACD penetrated this level. At the oversold level, the stock price often saw an increase shortly after this region was reached. Again, it is important to point out that these levels are subjective and will vary from security to security.


The third popular use of the MACD is to identify those times when it diverges from the security price. A divergence occurs when the trend of a security’s or index’s price does not agree with that of an indicator. In other words, an indicator trends in one direction while the price goes another, or does not go in the same direction. MACD divergences tend to preface a reversal in the current price trend of the security or index in question.

A bearish divergence occurs when the MACD is making new relative lows even though the price fails to make new lows. An even stronger warning is sounded in this case if the price makes a new relative high (the price peak is higher than the last price peak). This is the case in Figure 4 for Allegheny Energy. During the period from September 1995 through February 1996, both the price and MACD rose steadily. After that point, however, a divergence developed between the price and the indicator. From February of that year until January of 1997, the MACD made a steady decline while Allegheny’s price, for the most part, continued to make higher highs. The fall in the MACD is due to the coming together of the 12-week and 26-week exponential moving averages, which can also be seen in Figure 4. Eventually, the price reversed course and fell back in line with the MACD.

A bullish divergence takes place when the MACD is making new highs even though prices fail to reach new highs. Again, greater importance should be placed if the price makes a new relative low (a price trough is lower than the previous price trough) while this pattern develops. Furthermore, both signals carry greater significance if they occur at relative overbought or oversold levels.

Daily vs. weekly

All of the MACD examples here are calculated using weekly prices. No matter which indicator you use, signals generated always carry more weight as the time period being used to calculate the indicator increases. Weekly signals are more significant than daily signals, just as monthly signals carry more weight than weekly signals.

While weekly signals are of greater importance than daily signals, that is not to say you should write-off the usefulness of daily movements.

One technique used by technicians is to track the behavior of the MACD on a daily basis. However, instead of entering or exiting a trade based on a daily signal, they refer to the weekly chart to see where the MACD is. For example, if you receive a buy signal from the daily MACD and you see that on the weekly chart the MACD is in a bullish “condition,” you may wish to enter a long position. However, if the weekly MACD is in an overbought condition, you will probably want to ignore the buy signal from the daily MACD.

Overall, you can use daily charts to determine entry and/or exit points or to identify early trend warnings; ideally after you refer to a weekly chart.

trading companion

The MACD takes the principle of moving averages and advances it one step further.

This indicator is useful when examining the interaction between two moving averages. In addition, it is helpful in identifying points when the indicator and price diverge.

However you may use it, the MACD could be a useful trading companion.

Wayne A. Thorp, CFA is a vice president and senior financial analyst at AAII and editor of Computerized Investing. Follow him on Twitter at @WayneTAAII.


James from LA posted over 2 years ago:

Very helpful, easy to read, an excellent explanation.

You need to log in as a registered AAII user before commenting.
Create an account

Log In