Understanding MACD trading strategy: an educational guide

In this educational guide, learn about the MACD indicator, a popular technical analysis tool for identifying trends, momentum, and reversals.

What is MACD?

The moving average convergence/divergence (MACD) oscillator is a technical analysis tool that could help traders identify emerging price trends, upward or downward. 

In this guide, we take a look at how to use this indicator and create a MACD trading strategy. 


  • The moving average convergence/divergence indicator works with two separate moving averages, called the signal line and the MACD line, coupled with a histogram, and can be used to monitor market trends.

  • Traders could use MACD for identifying momentum, measuring a trend’s strength, and monitoring trend reversals. 

  • It could work in conjunction with a variety of other indicators, such as Bollinger Bands® and the relative strength index (RSI).

  • Traders could work with different types of MACD signals, such as bullish, bearish and divergence signals, to formulate a MACD trading strategy.

The MACD indicator explained

Classed as a momentum indicator, the MACD is based on the relationship between two moving price averages (MA) of the same asset’s price. Conceived by investment manager Gerald Appel in 1979, the MACD has risen to become one of the most popular technical trading indicators in use today.

How to trade with MACD

The MACD indicator consists of two moving averages, one faster one that is called the signal line and a slower one, which is the MACD line. It also includes a histogram that represents the difference between the two averages. 

  • Signal line: This is the exponential moving average (EMA) for the previous nine days of the MACD line.

  • MACD: The difference between the 26-day EMA and the 12-day EMA.

  • Histogram: The difference between the MACD line and the signal line, oscillating around a zero line. 


*Past performance is not a reliable indicator of future results

How does MACD work?

The MACD is derived from subtracting the 26-day exponential moving average (EMA) from the 12-day EMA. The signal line, which is the nine-day EMA of the MACD, is then drawn. The signal line could be used as a threshold to help define buying and selling points.

The EMA differs from a standard moving average in that greater weight is placed on the more recent data. In this way, the EMA responds more quickly to price changes versus a simple moving average. It differs from the regular weighted moving average (WMA) in that whereas the weight in the WMA increases on a regular basis, in the EMA it does so exponentially. 

The MACD formula

If we want to express how to get the MACD as a formula, this is it

MACD =12-Period EMA − 26-Period EMA

How to read the moving average convergence/divergence indicator?

Traders may consider using the MACD in the following ways:

  • Identifying momentum: Looking for places where the two moving averages crossover can suggest a change of momentum. 

  • Finding a trend’s strength: The size of the histogram’s bars can show traders how fast a price is moving, and what direction it is moving in.

  • Trend reversals: A divergence, where the price chart is going one way and the MACD is going another, can suggest that a reversal might be about to take place, although this is by no means guaranteed

Since it is derived from the actual price changes of the moving averages rather than the percentage changes, the MACD is categorised as an absolute price oscillator (APO) as opposed to a percentage price oscillator (PPO).

How to use the MACD indicator

Traders could use MACD signals to identify potential buy and sell scenarios in the market. The MACD generates signals through crossovers between the MACD line and the signal line, as well as through divergences between the MACD line and the price of the asset being analysed. Here are some ways to identify buy and sell signals using the MACD:

  • Bullish signal: A bullish signal occurs when the MACD line crosses above the signal line. This may indicate that the asset's price is likely to increase in the near term, and traders may consider buying the asset.

  • Bearish signal: A bearish signal occurs when the MACD line crosses below the signal line. This may indicate that the asset's price is likely to decrease in the near term, and traders may consider selling the asset.

  • Divergence signal: A divergence signal occurs when the MACD line diverges from the price of the asset. A bullish divergence occurs when the MACD line is making higher lows while the asset's price is making lower lows, indicating that a reversal in price may occur. A bearish divergence occurs when the MACD line is making lower highs while the asset's price is making higher highs, indicating that a potential trend reversal may occur.

Indicators that work with MACD

There are several technical indicators that traders could use in conjunction with MACD to confirm trend changes and generate trading signals. Some of these indicators include:

  • Relative strength index (RSI): RSI measures the strength of the asset's price movement and can confirm overbought or oversold conditions in the market.

  • Moving averages: Moving averages smooth out the asset's price movement and can assist traders identify support and resistance levels.

  • Bollinger Bands®: Bollinger Bands® can be used to identify potential breakouts and reversals.

  • Fibonacci retracements: Fibonacci retracements can determine potential support and resistance levels.

Traders could use these indicators in combination with the MACD indicator to increase the probability of accurate trading signals. However, it is important to note that no single indicator can provide a complete picture of the market, and traders may consider using multiple indicators and analysis to make informed decisions.

Timeframe selection

Selecting an appropriate timeframe could be useful when it comes to formulating a MACD trading strategy. Shorter timeframes, such as 5-minute or 15-minute charts, can generate more frequent signals, but may also produce more false signals due to market noise. Longer timeframes, such as daily or weekly charts, can provide more clear signals, but may have fewer chances to trade. 

Traders may consider their trading goals, risk tolerance, and preferred trading style when selecting a timeframe. It might be useful to monitor multiple timeframes to gain a complete picture of the market, and to adjust the timeframe as necessary based on changing market conditions.

Stop-loss and take-profit

Traders who use a MACD indicator strategy could also use stop-loss and take-profit orders. Stop-loss orders allow people to set a level of loss that they are prepared to suffer, while take-profit orders let them set a level of profit they are happy to take. 

It is important to note that, unless a trader utilises guaranteed stop-loss, which comes at a fee, it may not protect them from slippage in the events of extreme market volatility.

Testing the MACD

Backtesting and forward testing can be useful for evaluating the effectiveness and reliability of MACD strategies. Backtesting involves applying the strategy to historical market data to assess its performance, while forward testing involves applying the strategy to real-time market data to validate its efficacy. Both methods can help traders identify potential flaws and optimise the strategy for a potential better performance. 

MACD trading examples

Let’s take a look at some examples of trading with the Moving Average Convergence/Divergence indicator. 

Trading MACD crossovers

When the MACD rises above the signal line, traders view this as bullish and may choose to go long on the asset in anticipation of upward momentum.

In contrast, the MACD falling below the signal line is a bearish prompt that traders may act upon to take short positions in the asset as they seek to profit from price falls.

Trading MACD crossovers

*Past performance is not a reliable indicator of future results

In practice, the crossover signals from the MACD divergence should be supplemented with other technical and fundamental analysis, and at the very least some basic price analysis. For instance, to act on the bullish MACD crossover, when the MACD rises above the signal line, we could look for further confirmation such as the asset price breaching a resistance level.

Trading MACD divergences

A MACD chart can also help identify instances where an existing trend is coming to an end. When an asset’s price is falling but the MACD is rising, this could mean that a down phase may be at an end and a bullish price rally may be just around the corner.

Trading MACD divergences

*Past performance is not a reliable indicator of future results

In contrast, when a stock price is rising but the MACD is falling, then the current uptrend could be coming to an end, with a bearish retrace in the offing.

Trading with the MACD histogram

Trading with the MACD histogram

*Past performance is not a reliable indicator of future results

The histogram can also be used to help with a MACD trading strategy. Traders can examine the size of the bars in the histogram. If an asset’s price is moving quickly, the bars will be larger and if it is moving slower, they will be shorter. 

As the size of the bars increases, the moving average lines will move further apart and when they shrink they will get smaller. Therefore, this can give a trader the chance to potentially see signs that a crossover might take place. 


In conclusion, the moving average convergence/divergence indicator comprises a signal line, the MACD line itself and a histogram and is used to measure trends and momentum. 

Traders can use either crossovers or divergences in the MACD to create a trading strategy and can also measure the size and shape of the bars in the histogram. The MACD rising above the signal line may suggest the prices are rising and the MACD dropping below the signal line may indicate falling prices.  A divergence between the movement of the MACD and the market price chart can suggest a change in a trend, while the size and shape of the bars in the histogram can also indicate how fast prices are changing. 

Along with fundamental analysis such as news reports, MACD signals could be used in combination with a variety of other technical indicators to help traders make more informed decisions. However, the MACD cannot predict the future. Therefore, it is important that traders always make sure to do their own research, remember that markets can move against them, and to never trade with more money than they can afford to lose.


What does the MACD indicator tell you?

The MACD indicator tells traders about the momentum and trend direction of an asset's price. It does this by measuring the difference between two exponential moving averages and generating signals through crossovers and divergences.

How do you use MACD effectively?

To use MACD effectively, traders should use it in conjunction with other technical indicators and analysis, and adjust the settings to fit their trading style and the market conditions. Traders can also backtest and forward test their MACD strategy to ensure its effectiveness and reliability under different market conditions.

What is the best timeframe for the MACD?

This will depend on what market someone is trading in, as well as their goals and risk tolerance.

Which indicator works best with the MACD?

A range of indicators work in conjunction with the MACD, including the RSI, moving averages, Bollinger Bands® and Fibonacci retracements.

Ready to join a leading broker?

Join our community of traders worldwide
1. Create your account2. Make your first deposit3. Start trading