How to Trade Using the MACD Indicator?

David Becker
Updated: Aug 21, 2022, 11:25 GMT+00:00

Learn about Moving Average Convergence Divergence (MACD) Oscillator. How to trade using MACD indicator, MACD signal line and buy&sell crossover.

How to Trade Using the MACD Indicator?

In this article:

One of the most efficient ways to trade the currency markets using momentum is to employ a momentum indicator such as the Moving Average Convergence Divergence index (MACD).

The History of MACD Indicator

In the late 1970’s Gerald Appel introduced the Moving Average Convergence Divergence Oscillator. As the name implies the index compares 2-moving average and attempts to determine whether these averages are converging or diverging.  The initial goal of Appel was to generate an indicator that could describe periods when momentum was accelerating along with price action, as well as periods when prices were moving when momentum stalled.

What Does the MACD Measure?

The MACD measures momentum. The index is attempting to determine the accelerating in prices by comparing two moving averages to one another. A moving average is the average of specific prices over a certain period. You can use any price you want to generate a moving average. In general, the most common price that is used is a closing price. Since the forex market never officially closes, you have to determine the price that you will constitute as the close which can be a specific time. Most vendors who provide prices use 5pm eastern standard time to designate a closing price. This is the New York close of business for the forex market.

A simple 5-day moving average would be calculated by summing the last 5-closing prices and dividing that sum by five. On the sixth trading day, you would perform the same calculation dropping the first day and adding the sixth day.

To calculate momentum, the MACD measures the difference between two moving averages. The default is the 12-day exponential moving average, and the 26-day exponential moving average. This is also known as the MACD line. The MACD measures the difference between these two-moving average, and compares that difference, to the 9-day exponential moving average of that difference. There are no rules that say you need to use a 12-day and 26-day moving average. Traders that are looking for short term changes in momentum might also consider using a 5-day moving average and a 13-day moving average and comparing that difference to the 6-day moving average of the difference.

MACD Indicator

The chart above shows MACD as an indicator describing the EUR/USD currency pair. The green line is the MACD line (the 12-day EMA minus the 26-day EMA). The blue line is the signal line with is the 9-day EMA of the MACD line.  Finally, the red shade is the MACD histogram.

Since the MACD uses an exponential moving average, as opposed to a simple moving average, a question you might have is what is an exponential moving average, and how is that different from a simple moving average.

Exponential Moving Averages

An exponential moving average is used in many studies as it reduces the lag that occurs by applying more weight to recent prices. Since a moving average is a lagging indicator, many analysts are interested in applying more weight to current prices, as opposed to equal weight across all the prices used in the calculation of a moving average. Obviously, the weight that is used to place more importance on current prices is a function of the number of periods in the moving average. There are three steps to calculating an exponential moving average.

The first step is to calculate a simple moving average as we describe early. The second step is to calculate a weighting multiplier and the third step is to calculate the exponential moving average. For example:

A 12-period exponential moving average, which is the exponential moving average used in the MACD, applies an 15.38% weighting to the most recent price. This is calculated by (2/(12+1) = .1538). The shorter the moving average, the more weight that is placed on the current price. In fact, the weighting that is used to calculate the exponential moving average drops by half every time the moving average period doubles.

While there are differences between a simple moving average and an exponential moving average, one is not necessarily more efficient than the other. Exponential moving average display characteristics that have less lag, and therefore they are more sensitive to current changes in price action. Exponential moving average will change with price more quickly, which might be a good thing when prices are beginning to trend, and a bad thing when prices are chopping and consolidating.

Your preference in using a moving average will be determined by your objective.  When using the MACD, you are looking for a change in current momentum, which makes the exponential moving average better suited than a simple moving average.

MACD Formula – How to Calculate MACD?

The MACD is calculated in 3-steps. The first is to calculate the MACD line. This is performed by subtracting the 26-day exponential moving average from the 12-day exponential moving average. The second step in calculating the MACD is to generate a signal line. This is created by calculating the 9-day exponential moving average of the MACD line.

MACD Histogram: MACD Line – Signal Line

The MACD histogram was created by Thomas Aspray in 1986. The indicator measures the space between MACD and its signal line, which is the 9-day EMA of MACD line. The MACD histogram is an oscillator that traverses around a reading of zero. The histogram measures the trajectory of the MACD and can help you determine if there will be a crossover based on the change in trajectory. Because the MACD uses moving averages, which are lagging indicators, the changes in momentum based on a signal can be delayed, and the trajectory generated by the histogram can help you anticipate a signal.

The MACD-Histogram is also designed to identify convergence, divergence and crossovers. The MACD-Histogram, however, is measuring the distance between MACD and its signal line. The MACD histogram is positive when the signal line is rising. When the MACD histogram declines below the zero index then the MACD line moves below the MACD signal line. The MACD histogram is negative when MACD is below its signal line.

Using the MACD Indicator Strategy

There are several ways to use the MACD to help you with your trading. When choosing your broker, it is important to find out the technical indicators that the broker provides. As with most signals, using a combination of technical analysis tools is the most efficient way to generate income. When using the MACD, you can buy and sell using MACD crossovers, you can use the MACD histogram to determine the trajectory and anticipate a crossover, and you can look for divergence.

MACD Buy and Sell Crossover Signals

The crossover buy and sell signals, display where momentum is beginning to accelerate. The chart of the USD/JPY below show a buy signal, that is a crossover, and a sell signal that is a crossover. In both scenarios, the crossover was confirmed as the histogram moved from negative to positive territory in the case of the buy signal, and from positive to negative territory for the sell signal. The signal generated by the MACD reflects a change in momentum, but might be delayed given the nature of changes to lagging indicator such as moving averages.

Prior to the buy and sell signal, you can see that the histogram is moving closer to zero, reflecting a change in the trajectory of the MACD. For example, by evaluating the MACD histogram ahead of the buy signal that was generated in late April, you could have anticipated that there would be a MACD crossover buy signal. The trajectory is somewhat subjective, but you can use trend lines to analyze the histogram.

MACD Indicator

You can also use multiple MACD time periods to evaluate your crossover. For example, using the same chart of the USD/JPY, you can place two different MACD periods with different crossover periods. The chart shows the default of the 12-day EMA, the 26-day EMA and the 9-day EMA which is the signal line. The chart shows below that a 5-day EMA, the 13-day EMA and the 6-day EMA signal line.  The short term MACD turns quicker but will also pick up many false signals where momentum has turned but fizzles out.

MACD Indicator

MACD Divergence

Another type of signal that is generate through the MACD is divergence. The term describes a period where prices are moving in one direction but momentum is moving in another direction. This is evident when you have a higher peak in a bullish divergence or a lower peak in a bearish divergence. It also can form when the MACD line forms a lower low but the histogram does not.

In the example above, the USD/JPY MACD histogram has a trough that is a high low. At the same time, prices continue to move lower, which describes a scenario where prices are declining but negative momentum is abating. Additionally, in this situation the MACD also forms a lower low, which sets up a divergence. This can also be a set up for a crossover that is very powerful.


The MACD (moving average convergence divergence) is a momentum indicator that is designed to find changes in momentum. The index is calculated by subtracting one moving average from another (the 12-day EMA minus the 26-day EMA) and plotting that MACD line versus the 9-day EMA of the MACD which is called the signal line.

The MACD uses exponential moving average as opposed to simple moving averages. An exponential moving average puts additional weight on current prices and attempt to remove the lag associated with using moving averages as a technical indicator.

The MACD was developed in the 1970’s and initially used to determine momentum. The crossover signal, which is calculated when the MACD line crosses above or below the MACD signal line. This describes either accelerating positive or negative momentum.

In the 1980’s the MACD histogram was developed. The histogram shows the distribution of the MACD signal line. This can be used to anticipate the MACD crossover, as it helps to evaluate the trajectory of the MACD line.

The most popular way to trade the MACD is via MACD crossover signals. Another way is by using divergence. Divergence occurs when prices or the MACD line moves in one direction and the trajectory of the MACD histogram begins to change. Regardless of how you use the MACD, it is an excellent technical analysis tool to use to measure momentum.

Tips From the Expert

  • Focus on the crossover to drive momentum trading decisions
  • You can use the MACD histogram to gauge the trajectory of momentum which helps anticipate a crossover signal
  • You can change the MACD line and signal calculation to capture short or long term momentum
  • Use trend lines to gauge if the MACD histogram is trending higher or lower
  • You can gauge divergence by comparing the MACD histogram to the MACD line or the exchange rate

About the Author

David Becker focuses his attention on various consulting and portfolio management activities at Fortuity LLC, where he currently provides oversight for a multimillion-dollar portfolio consisting of commodities, debt, equities, real estate, and more.