Article Hero

MACD Indicator

11 minutes
Beginner
Cristian Cochintu
Cristian Cochintu
11 September 2023

MACD helps investors understand whether the bullish or bearish movement in the price is strengthening or weakening. Here is how to use MACD indicator in trading and the most popular MACD trading strategies.

The MACD is a relatively simple indicator, easy to comprehend, appeals to intuitive logic, and therefore resonates well with most traders. It can be a powerful tool if used effectively, especially for assessing the strength and momentum of trends and consequently predicting their continuance and potential reversal. 

How to use this MACD trading guide 

To get the most out of this guide, it’s recommended to practice putting these MACD indicator trading strategies into action. The best risk-free way to test these strategies is with a demo account, which gives you access to our trading platform and $50,000 in virtual funds for you to practice with. Get your free demo account. 

Once you’ve found a strategy that consistently delivers positive results, it’s time to upgrade to a fully funded live account where you can apply your newfound edge.

    

What is MACD? 

The Moving Average Convergence Divergence (MACD) is an oscillator type indicator that is widely used by traders for technical analysis. MACD is a trend-following tool that utilizes moving averages to determine the momentum of a currency pair or another tradeable asset. 

Developed by Gerald Appel in the late 1970s, the Moving Average Convergence Divergence indicator tracks pricing events that have already occurred and, thus, fall into the category of lagging indicators (which provide signals based on past price action or data). The MACD may be useful for measuring market momentum and possible price trends and is utilized by many traders to spot potential entry and exit points. 

The MACD indicator is available on the CAPEX platform, WebTrader. Our award-winning platform allows traders to customize technical indicators and tools, add drawing tools to price charts and graphs, and identify chart patterns in order to improve their trading strategy. 

How to read MACD indicator  

The MACD indicator is generated by subtracting two exponential moving averages (EMAs) to create the main line (MACD line), which is then used to calculate another EMA that represents the signal line. 

In addition, there is the MACD histogram, which is calculated based on the differences between those two lines. The histogram, along with the other two lines, fluctuates above and below a centerline, which is also known as the zero line. 

Therefore, the MACD indicator consists of three elements moving around the zero line: 

  1. The MACD line (Blue): helps determine upward or downward momentum (market trend). It is calculated by subtracting two exponential moving averages (EMA).  
  2. The MACD signal line (Red): an EMA of the MACD line (usually 9-period EMA). The combined analysis of the signal line with the MACD line may be helpful in spotting potential reversals or entry and exit points.
  3. The MACD Histogram (Bars): a graphical representation of the divergence and convergence of the MACD line and the signal line. In other words, the MACD histogram is calculated based on the differences between the two lines. 
MACD indicator
Blue Line = MACD, Red Line = Signal Line, Red and Green Bars = Histogram

  The idea behind the MACD is simple: 

  • The degree/magnitude of separation between a shorter and longer-term moving average (MA) denotes the strength of a trend. It also indicates the momentum of that trend. 
  • The underlying logic is that a shorter-term MA reflects current price action; whereas a longer-term MA reflects earlier price action, in addition to the current price action. 
  • If there is a good separation between these two MAs, it means that the current price action is moving away from the earlier price action. This indicates that the market is trending either up or down. 

MACD Calculation Formula 

The mathematics behind MACD is relatively simple and powerful when used effectively. 

The MACD line calculation formula 

In general, the exponential moving averages are measured according to the closing prices of an asset, and the periods used to calculate the two EMAs are usually set as 12 periods (faster) and 26 periods (slower). The period may be configured in different ways (minutes, hours, days, weeks, months), but this article will focus more on daily settings. Still, the MACD settings may be customized to accommodate different trading strategies.

Assuming the standard time ranges, the MACD line itself is calculated by subtracting the 26-day EMA from the 12-day EMA. 

  • MACD line = 12d EMA - 26d EMA 

As mentioned, the MACD line oscillates above and below the zero line, and this is what signals the centerline crossovers, telling traders when the 12-day and 26-day EMA are changing their relative position. 

The MACD signal line calculation formula 

By default, the signal line is calculated from a 9-day EMA of the main line and, as such, provides further insights into its previous movements. 

  • Signal line = 9d EMA of MACD line 

Although they are not always accurate, when the MACD line and signal line cross, these events are usually deemed as trend reversal signals, especially when they happen at the extremities of the MACD chart (far above or far below the zero line). 

The MACD histogram calculation formula 

The histogram is nothing more than a visual record of the relative movements of the MACD line and the signal line. It is simply calculated by subtracting one from the other: 

  • MACD histogram = MACD line - signal line 

However, instead of adding a third moving line, the histogram is made of a bar graph, making it visually easier to read and interpret. Note that the histogram bars have nothing to do with the trading volume of the asset. 

MACD Signals 

As its name implies, the MACD is all about the convergence and divergence of the two moving averages. Convergence occurs when the moving averages move towards each other. Divergence occurs when the moving averages move away from each other. The shorter moving average (12-day) is faster and responsible for most MACD movements. The longer moving average (26-day) is slower and less reactive to price changes in the underlying security. 

The MACD line oscillates above and below the zero line, which is also known as the centerline. These crossovers signal that the 12-day EMA has crossed the 26-day EMA. The direction, of course, depends on the direction of the moving average cross. Positive MACD indicates that the 12-day EMA is above the 26-day EMA. Positive values increase as the shorter EMA diverges further from the longer EMA. This means the upside momentum is increasing. Negative MACD values indicate that the 12-day EMA is below the 26-day EMA. Negative values increase as the shorter EMA diverges further below the longer EMA. This means downside momentum is increasing. 

As the USA30 chart shows, the MACD measures momentum or trend strength by using the MACD line and zero line as reference points: 

MACD calculation
Blue Line = MACD, Red Line = Signal Line, Red and Green Bars = Histogram
  • When the MACD line crosses ABOVE the zero line, this signals an UPTREND 
  • When the MACD line crosses BELOW the zero line, this signals a DOWNTREND 

In addition, the MACD signals buy or sell orders which are given when the two MACD lines cross over as outlined below: 

  • When the MACD line crosses ABOVE the signal line, traders use this as a BUY indication 
  • When the MACD line crosses BELOW the signal line, traders use this as a SELL indication  

How can you use MACD in trading 

When you see the MACD signals and you want to place a trade, you can do so via derivatives such as CFDs. Derivatives enable you to trade rising as well as declining prices. So, depending on what you think will happen with the asset’s price when one of the MACD signals appears, you can open a long position or a short position. 

Follow these steps to trade when you see the stochastic signals: 

  • Trading any type of technical indicator requires patience and the ability to wait for confirmation. The appearance of one of these MACD signals alerts traders of a price reversal, but until that occurs, most traders leave the pattern alone. 
  • To get started trading the MACD indicator, open an account. Choose between a live account to trade CFDs straight away or practice first on our demo account with virtual funds. 
  • Choose your financial instrument. MACD signals can be spotted in most financial markets, especially those that are more volatile, such as forex, cryptocurrencies, and stocks 
  • Explore our online trading platform. We offer a wide range of technical indicators that are not limited to MACD, as well as providing a range of order execution tools for fast trading, which in turn helps you to manage risk. 

    

The below strategies for trading MACD signals are merely guidance and cannot be relied on for profit. 

Signal Line Crossovers 

Signal line crossovers are the most common MACD signals. The signal line is a 9-day EMA of the MACD line. As a moving average of the indicator, it trails the MACD and makes it easier to spot MACD turns. A bullish crossover occurs when the MACD turns up and crosses above the signal line. A bearish crossover occurs when the MACD turns down and crosses below the signal line. Crossovers can last a few days or a few weeks, depending on the strength of the move. 

The USA500 chart shows some bullish (green vertical lines) and bearish (red vertical lines) signal line crossovers. 

MACD Signal Line Crossovers 
Vertical Red Lines = Bearish signals, Vertical Green Lines = Bullish signals

Due diligence is required before relying on these common signals. Signal line crossovers at positive or negative extremes should be viewed with caution. Even though the MACD does not have upper and lower limits, chartists can estimate historical extremes with a simple visual assessment. It takes a strong move in the underlying security to push momentum to an extreme. Even though the move may continue, momentum is likely to slow, and this will usually produce a signal line crossover at the extremities. Volatility in the underlying security can also increase the number of crossovers. 

As the crossover strategy is lagging by nature, it is based on waiting for a movement to occur before opening a position. The main issue faced by the MACD in weaker market trends is that by the time a signal is generated, the price may be reaching a reversal point. This would then be considered a ‘false signal’. It is worth noting that strategies that utilize price action for confirmation of a signal are often seen as more reliable. Crossovers are more reliable when they conform to the prevailing trend. If the MACD crosses above its signal line following a brief correction within a longer-term uptrend, it qualifies as bullish confirmation. 

As a result, bullish crossovers should be considered at key support levels in uptrends, while bearish crossovers should be considered at key resistance levels in downtrends. Learn more about support and resistance.

Centerline Crossovers 

Centerline crossovers are the next most common MACD signals. A bullish centerline crossover occurs when the MACD line moves above the zero line to turn positive. This happens when the 12-day EMA of the underlying security moves above the 26-day EMA. A bearish centerline crossover occurs when the MACD moves below the zero line to turn negative. This happens when the 12-day EMA moves below the 26-day EMA. 

Centerline crossovers can last a few days or a few months, depending on the strength of the trend. The MACD will remain positive as long as there is a sustained uptrend. The MACD will remain negative when there is a sustained downtrend.  

The US Tech100 chart shows some bullish (green vertical lines) and bearish (red vertical lines) centerline crossovers. 

MACD Centerline Crossovers
Vertical Red Lines = Bearish signals, Vertical Green Lines = Bullish signals

This method should be used carefully, as the delayed nature means that fast, choppy markets would often see the signals issued too late. There can be numerous whipsaws because strong trends do not materialize after the crossovers. 

However, as a tool for providing reversal signals of long sweeping moves, this can be very useful. When using this MACD strategy, it is crucial to understand where to exit the market or place a stop.   

MACD Divergence 

When the MACD forms highs or lows that diverge from the corresponding highs and lows in the price, it is called a divergence. A bullish divergence appears when the MACD forms two rising lows that correspond with two falling lows on the price. This is a valid bullish signal when the long-term trend is still positive. 

Some traders will look for bullish divergences even when the long-term trend is negative because they can signal a change in the trend, although this technique is less reliable. 

MACD Divergence
MACD bullish divergence

When the MACD forms a series of two falling highs that correspond with two rising highs on the price, a bearish divergence has been formed. A bearish divergence that appears during a long-term bearish trend is considered confirmation that the trend is likely to continue. 

Some traders will watch for bearish divergences during long-term bullish trends because they can signal weakness in the trend. However, it is not as reliable as a bearish divergence during a bearish trend. 

MACD bearish divergence
MACD bearish divergence

Using a divergence signal as a forecasting tool is questionable. A divergence trade is not as accurate as it appears in hindsight because past data will only include successful divergence signals. A visual inspection of past chart data won’t reveal the failed divergences because they no longer appear as a divergence.     

MACD strategy key takeaways 

The MACD can provide a visual snapshot to help analyze trends, allowing traders to scan charts rapidly. That makes it an invaluable tool for technical analysis, especially with the myriad of financial instruments available to traders today, the forex market, as well as indices, commodities, and shares.   

  • MACD is one of the most used technical analysis indicators 
  • It works using three components: two moving averages and a histogram 
  • If the two moving averages come together, they are said to be ‘converging’ and if they move away from each other, they are ‘diverging’ 
  • The difference between the lines is represented on the histogram 
  • There are three common MACD strategies: signal line crossovers, centerline crossovers, and divergences 
  • MACD signals should be used in combination with price action and other technical analysis tools to filter the fake signals 
  • When you spot a stochastic signal, you can trade using derivatives such as CFDs 
  • With derivatives, you can go long or short because you do not own the underlying asset 

   

Free trading tools and resources 

Remember, you should have some trading experience and knowledge before you decide to trade with indicators. You should consider using the educational resources we offer like  CAPEX Academy or a demo trading account. CAPEX Academy has lots of free trading courses for you to choose from, and they all tackle a different financial concept or process – like the basics of analyses – to help you to become a better trader. 

Our demo account is a great place for you to learn more about leveraged trading, and you’ll be able to get an intimate understanding of how CFDs work – as well as what it’s like to trade with leverage – before risking real capital. For this reason, a demo account with us is a great tool for investors who are looking to make a transition to leveraged trading. 

FAQs about MACD indicator

This information prepared by capex.com/en is not an offer or a solicitation for the purpose of purchase or sale of any financial products referred to herein or to enter into any legal relations, nor an advice or a recommendation with respect to such financial products.This information is prepared for general circulation. It does not have regard to the specific investment objectives, financial situation or the particular needs of any recipient.You should independently evaluate each financial product and consider the suitability of such a financial product, by taking into account your specific investment objectives, financial situation or particular needs, and by consulting an independent financial adviser as needed, before dealing in any financial products mentioned in this document.This information may not be published, circulated, reproduced or distributed in whole or in part to any other person without the Company’s prior written consent.Past performance is not always indicative of likely or future performance. Any views or opinions presented are solely those of the author and do not necessarily represent those of capex.com/en 

Share this course

How did you find this article?

Awful
Ok
Great
Awesome

Read More

Cristian Cochintu
Cristian Cochintu
Financial Writer

Cristian Cochintu writes about trading and investing for CAPEX.com. Cristian has more than 15 years of brokerage, freelance, and in-house experience writing for financial institutions and coaching financial writers.