How to Trade the MACD

The moving average convergence divergence (MACD) is an oscillator that combines two exponential moving averages (EMA)—the 26-period and the 12-period—to indicate the momentum of a bullish or bearish trend. MACD can be used to signal opportunities to enter and exit positions.

It is one of the most popular technical indicators in trading and is appreciated by traders worldwide for its simplicity and flexibility.

Read on to learn about the MACD and some of the MACD strategies used by traders.

Key Takeaways

  • MACD is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. 
  • Traders use the MACD to identify entry and exit points for trades.
  • MACD is used by technical traders in stock, bond, commodities, and FX markets.
  • Some MACD strategies include the histogram, the crossover, the zero-cross, the money flow index, and the relative vigor index.
  • One of the biggest risks of the MACD is that a reversal signal can be a false indicator.

MACD: An Overview

The concept behind the MACD is straightforward. It calculates the difference between a security's 26-day and 12-day exponential moving averages (EMA). Each moving average uses the closing price of its period (26- and 12-day) to calculate its moving average value.

On the MACD chart, a nine-period EMA of the MACD itself is also plotted. This line is called the signal line. It acts as a trigger for buy and sell decisions when the MACD crosses over it. The MACD is considered the faster line because the points plotted move more than the signal line, which is regarded as the slower line.

MACD Histogram

The MACD histogram is a visual representation of the difference between the MACD and its nine-day EMA—not highs and lows. The histogram is positive when the MACD is above its nine-day EMA and negative when the MACD is below its nine-day EMA. The point on the histogram where momentum is zero is the zero line.

If prices change rapidly, the histogram bars grow longer as the speed of the price movement—its momentum—accelerates and shrinks as price movement decelerates.

MACD chart

Trading Divergence

Divergence refers to a situation where factors move away from or are independent of others. With the MACD, it is a situation where price action and momentum are not acting together.

For instance, divergence can indicate a period where the price makes successively lower highs, but the MACD histogram shows a succession of higher lows. In this case, the highs are moving lower, and price momentum is slowing, foreshadowing a decline that eventually follows.

By averaging up their short, the trader eventually earns a handsome profit, as the price makes a sustained reversal after the final point of divergence.

The moving average convergence divergence was invented by Gerald Appel.

Types of MACD Strategies

Histogram

The MACD histogram can be a useful tool for some traders. While we've explained a little bit above about how to read it, here's how it works. It plots out the difference between the fast MACD line and the signal line. Traders can use the MACD histogram as a momentum indicator to jump ahead of changes in market sentiment.

There are three different elements involved with the histogram, which is mapped out around a baseline:

  • The MACD line (produced by subtracting a long-term EMA from a shorter-term EMA)
  • The signal line (produced by subtracting the two EMAs and creating a nine-day moving average)
  • The histogram (produced by subtracting the MACD line from the signal line)

Keep in mind, though, that the MACD histogram has its faults (see the "Drawbacks" section below). Many traders often use other tools and techniques to determine and make their moves based on market sentiment, such as the trading volume of a given security.

Crossover Strategy

A crossover occurs when the signal and MACD line cross each other. The MACD generates a bullish signal when it moves above its own nine-day EMA and triggers a sell signal (bearish) when it moves below its nine-day EMA.

MACD Crossover

Zero-Cross Strategy

When the MACD crosses from below to above the zero line, it is considered a bullish signal. Traders generally take long positions when this occurs. If it crosses from above to below the zero line, it is considered a bearish signal by traders. Traders then enter short positions to take advantage of falling prices and increasing downward momentum.

MACD zero-cross

In both cases, the longer the histogram bars, the stronger the signal. When there is a strong signal, it is more likely—but not guaranteed—that the price will continue in the trending direction.

Money Flow Index

The money flow index allows traders to use price and trading volume to identify and determine when assets are overbought or oversold in the market. This oscillator moves between 0 and 100 where readings below 20 are oversold and 80 are considered overbought.

One of the drawbacks of this strategy, though, is that it tends to produce fewer signals. That's because the readings it produces are extreme due to the fact that they are focused on spurts in volume and prices.

Relative Vigor Index (RVI)

The relative vigor index (RVI) is a commonly used momentum indicator in technical analysis. It measures how strong a trend is by comparing the trading range of a certain security with its closing price. The comparison is made by using a simple moving average (SMA) to smooth the results out.

Traders generally believe that the value of the RVI increases as a bullish trend continues to gain momentum. That's because, in this case, an asset's closing price tends to fall at the higher end of the range. The opening price, on the other hand, stays further down on the lower end of the range.

MACD With RSI and SMA

Traders may often use the MACD and relative strength index (RSI) indicator strategy. This allows them to use both the RSI and the SMA to their advantage. But what are they?

  • The RSI allows traders to measure how strong a trend is while being able to pinpoint different points of reversal along that trendline. This is mapped along a baseline of 14 periods over two different levels: an oversold and an overbought one. Where the levels are set depends entirely on the trader and their strategies. Some may choose conservative levels of 20 and 80.
  • The SMA calculates the average range of prices by the number of periods in that range, usually with closing prices. This indicator allows traders to assess whether they believe a trend will continue or reverse.

Combining these three strategies together allows traders to:

  • Project future price changes using the RSI
  • See how strong a trend is and where it's headed using the MACD
  • Use the SMA as a lagging trend-following indicator

Drawbacks of MACD

Like any oscillator or indicator, the MACD has drawbacks and risks.

  • One of the most significant risks is that a reversal signal can be a false indicator. For instance, the zero-cross image above has a point where the MACD crosses from below and back again in one trading session. If a trader entered a long position when the MACD crossed from below, they would be left with a losing stock if prices continued to fall.
  • MACD does not function well in sideways markets. If prices generally move to the side when they stay within a range between support and resistance. MACD tends to drift toward the zero line because there is no up or down trend—where the moving average works best.
  • Additionally, the MACD zero-cross is a lagging indicator because the price is generally above the previous low before the MACD crosses the line from below. This can cause you to enter a long position later than you might have been able to.

Example of a MACD Trading Strategy

We'll use our zero-cross image for a MACD trading example. As trading proceeds, you observe the MACD initially crossed the zero line from below, then crossed again from above. A trader might notice the histogram bars moving down with the MACD, indicating a possible reversal and opportunity for a short trade.

MACD zero-cross

When the line crossed from above, the trader could take a short position and net a profit when the prices began to climb again.

The zero-cross strategy could be used again to take a long position when the MACD crosses the zero line from below. At the point circled in our image, prices have been rising and momentum is up. The trader could take a long position at this point.

What Is the Best MACD Strategy?

There are several strategies for trading the MACD. The best strategy for you depends on your preferred trading style and which one you're comfortable using.

Which Indicator Works Best With the MACD Strategy?

In general, most traders use candlestick charts and support and resistance levels with MACD.

Why Does MACD Use 12 and 26?

MACD uses 12 and 26 as the default number of days because these are the standard variables most traders use. However, you can use any combination of days to calculate the MACD that works for you.

The Bottom Line

MACD is one of the most-used oscillators because it has been proven to be a reliable method for identifying trend reversals and momentum. There are various strategies for trading MACD, including those described above. Try each out to find the one that works best for you and your trading plan.

Article Sources
Investopedia requires writers to use primary sources to support their work. These include white papers, government data, original reporting, and interviews with industry experts. We also reference original research from other reputable publishers where appropriate. You can learn more about the standards we follow in producing accurate, unbiased content in our editorial policy.
  1. CMT Association. "Gerald Appel."

Take the Next Step to Invest
×
The offers that appear in this table are from partnerships from which Investopedia receives compensation. This compensation may impact how and where listings appear. Investopedia does not include all offers available in the marketplace.