Moving average convergence divergence (MACD) is one of the most popular **technical indicators** in swing trading. It can be used as either a trend or momentum indicator. It is a lagging indicator used to identify moving averages that are indicating a new trend. If the market is in a trading channel, as opposed to trending up or down, the MACD divergence may be a good technical indicator to use.

## How Does the MACD Indicator Work?

MACD calculates the difference between a security’s 26-day and 12-day exponential moving averages (EMA). The 12-day EMA is the faster one and responsible for most MACD movements. The 26-day EMA is the slower one and is less reactive to price changes. Both moving averages use the closing prices. Many traders confuse these two lines with simple moving averages. It is important to remember that the two lines drawn are not moving averages of the price but rather, they are the moving averages of the difference between two moving averages.

Since the MACD line is the difference between the two EMA, whenever the MACD crosses over the zero line, it signals that the 12-day EMA has crossed the 26-day EMA. Positive MACD means that the 12-day EMA is above the 26-day EMA. Positive values increase as the faster 12-day EMA diverges further from the slower 26-day EMA. This means upside momentum is increasing. Negative MACD means that the 12-day EMA is below the 26-day EMA. Negative values increase as the faster 12-day EMA diverges further below the slower EMA. This means downside momentum is increasing. This is indicated in the chart below of Citigroup. The green arrows indicate that the differences between the two EMA is zero, thus the MACD crosses over the zero line.

In the example above, when the MACD line (black line) is above the zero line, or in the positive territory, the 12-day EMA is trading above the 26-day EMA. The first cross was in mid-January (green arrow) and the MACD moves further into negative territory as the 12-day EMA moved further below the 26-day EMA.

Buy and sell signals are presented by 2 lines: the MACD line and the signal line. The MACD line is the difference between the 12-day EMA and 26-day EMA. The signal line is the 9-day EMA of MACD line. These two lines fluctuate around the zero line, or the centerline, which acts as support and resistance. The difference between the MACD line and the signal line is presented as a bar chart around the zero line and is called the MACD histogram. It is designed to illustrate crossovers, which indicate buy and sell signals.

For MACD charts, you will usually see three numbers used for its settings. If you see “12,26,9” as the MACD parameters, which is often the default setting in most charting software, this is how you should interpret it as:

- The 12 is the previous 12 bars of the faster moving average
- The 26 is the previous 26 bars of the slower moving average
- The 9 is the previous 9 bars that is used to calculate the moving average of the difference between the faster and slower moving averages.

In summary, the calculation is below:

- MACD Line – 12 day EMA – 26 day EMA
- Signal Line – 9-day EMA of MACD Line
- MACD Histogram- MACD Line – Signal Line

On the MACD chart, a 9 day EMA of the MACD is plotted and acts as buy and sell signals. The MACD indicates a bullish signal when it crosses above its own 9-day EMA, or signal line, and it indicates a bearish signal when it moves below its 9-day EMA.

## MACD Histogram

The MACD histogram represents the difference between the MACD and its 9-day EMA. The histogram shows a positive value when the faster moving line crosses above the slower moving line and negative when the fast crosses below the slow. In other words, it’s positive when the MACD is above its Signal Line and negative when the MACD is below its Signal Line.

When you see the faster and slower moving averages separate, the histogram gets bigger. This is known as divergence because the faster moving average is “diverging” away from the slower moving average. When the moving averages move closer to each other, the histogram gets smaller. This is known as convergence because the moving averages are moving towards each other. This is how MACD gets its name Moving Average Convergence Divergence.

The faster moving average will be faster to react to price movement than the slower one. Many traders use the MACD histogram to measure momentum since it responds to the speed of price movement. In fact, many use the MACD indicator to test the strength of the price move more than to determine the direction of the trend.

Whenever the histogram bars decrease, it shows the potential for a crossover.

## MACD Trading Strategy

When there’s a new trend, the faster moving average line will react first and eventually cross the slower line. When this crossover happens and the fast line starts to diverge away from the slower line, it often signals that a new trend has formed in the direction of the cross. Traders often use this as a sign to enter new trades.

Traders use signal line crossovers, centerline crossovers, and divergences to determine buy and sell signals.

## MACD Crossovers

### Signal Line Crossovers

The 9-day EMA of the MACD line, or the signal line, trails the MACD. A **bullish crossover** is when the MACD turns up and crosses above the signal line. A **bearish crossover** is when MACD turns down and crosses below the signal line. Crossovers can range from a few days to a few weeks depending on the strength of the trend. These signals are quite common so due diligence is needed.

Take a look at PYPL below. There was a bullish crossover mid-April where the black line crossed above the red line. This was then followed by a gap up on high volume and the trend continue to increase. You can see the moving averages diverge and the histogram getting bigger. Then, a bearish crossover occurred mid-May, but PYPL continued trending higher. This means that even though the price is increasing, the upward momentum has slowed down.

### Centerline Crossovers

The second most common MACD signals are the centerline crossovers. A **bullish centerline crossover** is when the MACD line moves above the zero line to the positive area. This occurs when the 12-day EMA, the faster moving line, moves above the 26-day EMA. On the other hand, a **bearish centerline crossover** is when the MACD line moves below the zero line to the negative territory. These crossovers can range from a few days to a few months depending on the strength of the move. The MACD would continue to above the zero line as long as there is a sustained uptrend. Likewise, it would remain below the zero line as long as there is a sustained downtrend.

Below is a chart of FB with one centerline crossover in the beginning of 2017. This signal lasted at least 6 months, where the 12-day EMA was above the 26-day EMA for 6 months. This was a strong trend.

## MACD Divergences

Trading divergence is one of the ways in which the MACD histogram is used. Divergences occur when the MACD diverges from the price. When a price makes a new high or a new low, but the MACD histogram does not, it indicates that there is a divergence between price and momentum.

A **bullish divergence** is when the price has a lower low but the MACD forms a higher low. The lower low indicates the current downtrend but the higher low in the MACD signals less downside momentum. Slowing momentum can signal a potential trend reversal.

The below chart of KORS shows a bullish divergence where Michael Kors formed a lower low in February but the MACD formed a higher low. There was also a signal line crossover where the signal line crossed over the MACD line. You’ll also notice that when the two lines crossed, the histogram is gone. This is because the difference between the MACD and signal lines when they cross is zero.

A **bearish divergence** is when the price has a higher high but the MACD line forms a lower high. The higher high shows the current uptrend but the lower high in the MACD shows less upside momentum.

The below chart of AIZ shows a bearish divergence where AIZ formed a higher high in March but the MACD formed a lower high. The subsequent signal line crossover is bearish, where the signal line crossed over the MACD line.

Oscillators such as the MACD are typically most important when their value reaches its extremities, which is when the MACD and signal lines are far away from the zero line. When MACD is well below the zero line in the negative area, it may be suggesting that the market is oversold. Conversely, when the MACD is well above the zero line in the positive area, it may be suggesting that the market is overbought.

One of the disadvantages of MACD trading strategy is that, since it is a lagging indicator, moving averages lag behind actual prices. Nevertheless, MACD is still one of the most popular technical analysis strategies that swing traders love to use so it is helpful to know **how to trade the MACD indicator**.

To find stocks with MACD crossover patterns, try the MACD stock screener.

**Stock Trading** related articles

Swing Trading Strategies

How to Read Stock Charts

How to Read Candlestick Charts

What is Technical Analysis

How to Trade Fibonacci Retracements

Fibonacci Trading Strategy

How To Trade Stocks Using Technical Analysis

Top 10 Swing Trading Books

Check out the Trading System that combines a scanning system, charting platform, trading system and trader education all in one place.