Moving Average Convergence Divergence (MACD)
Table of Contents
MACD (Moving Average Convergence Divergence) is one of the most popular and widely used technical analysis Indicators. MACD indicator was invented by Gerald Appel in 1960s. In this section we will discuss about it's concepts, construction, types of trading signals with examples and also an insight of MACD trading strategies.
Moving Average Convergence Divergence is a momentum Oscillator and can be used to determine the momentum of the price action. MACD is comprised of two EMAs (Exponential Moving Averages) of two different time periods i.e. one for longer time period and another for shorter period. The most common EMA's used for MACD are of 12 periods and 26 periods.
MACD is unique as it has the elements of lagging indicator as well as leading indicator. While saying this please note that no indicator can be an absolute leading indicator. The reason is simple as the signals are generated only after some confirmation of the direction of the price action. Please note the following points for the statement made above.
- Moving averages are trend-following indicators. Trend following indicators are those which tend to confirm the trend after the trend has begun and hence are classified as lagging indicators.
- However, by taking the differences in the moving averages, this indicator incorporates the aspects of momentum or leading elements. Because of this it tells us in advance (with a slight time lag) about the possibilities of a reversal in the ongoing trend. This is explained later in this tutorial.
MACD falls in the category of momentum oscillators. During a bullish or bearish market it helps us in analyzing if the momentum of the trend is getting stronger or is it weakening. In the absence of a trend or during a weak trend it tends to generate more false signals and hence is those situations we should avoid the use of this indicator.
Price Action Momentum In Trading:
In trading the momentum is the rate of price increase during an uptrend and rate of price decrease during a downtrend.
Let's try to see a hypothetical example of the price action of EUR/USD.
|Day||Opening Price||Closing Price||Change (Pips)|
Now as we see that the price has been continuously increasing and indicates an uptrend. Let's say that this is the last day of the week i.e. day 5 and we decide to take a long position. The fact we are ignoring here is that even though the prices have been increasing but there was a sudden drop in the momentum after Day 3. It may indicate the possibilities of a reversal of the trend or a consolidation before the uptrend resumes.
Momentum takes out the illusion of the trend even if there is a constant upward or downward movement. And it tells us if the rate of change is slowing down or going up. Buying is signaled when the uptrend is gaining momentum and selling is signaled when the downtrend starts gaining momentum. MACD helps us in analyzing this
Let's assume that there is an ongoing uptrend. Before entering the long position we would like to know if the momentum of the upward momentum is keeping up or there is any loss of momentum recently. A loss in the momentum may indicate the possibilities of a consolidation or even a reversal in the trend. Moving Average Convergence Divergence helps us in estimating the momentum of the trend.
During an uptrend we would like to go for a long position when the uptrend is gaining momentum as in that case we can expect further upwards moves. Similarly in a downtrend we would like to enter a short position when the downward momentum is getting stronger as further drop in the price can be expected. But when the momentum is slowing down in either case then we may need to hold ourselves from entering a market and may prefer to wait and watch. Hence knowing about the momentum of the trend is very important and MACD helps us in determining that.
MACD is calculated by using the following formula:
MACD = (Shorter term moving average) - (Longer term moving average).
The variables are the periods for the moving averages. Please read the following section about the period settings for the explanation.
The most common period setting for MACD is 26, 12, 9. Here “26” is the EMA of previous 26 periods, “12” is the EMA of previous 12 periods. And MACD would be the line constructed by joining the points which we get by deducting the EMA(26) from EMA(12). In our case it means MACD = EMA of 12 periods – EMA of 26 periods. The third constant in this period setting i.e. "9" is explained later in this section.
Uptrend: If the EMA of previous 12 periods (more recent data) is going over the EMA of 26 periods (longer time frame data), it would indicate that recently the prices have started moving upward.
Downtrend: If the EMA of previous 12 periods i.e. the more recent prices is going below the EMA of 26 periods, it would indicate that in recently the prices have started going down.
Now how do we find out the momentum by using MACD? Please see the chart 1 below.
If we see the above EUR/USD chart, we find that there is one more line which is running along with the main MACD line. This second line is known as “MACD Signal Line”.
The Signal line is derived by taking the Exponential Moving Average (EMA) of the MACD line. The setting MACD (26,12, 9) means that we are taking the EMA of MACD for pervious 9 periods.
We have already seen that if the shorter-term moving average is more than the longer term moving average, it indicates an uptrend situation on that time frame chart. The question now is that how do we find out the momentum of the uptrend. We find the momentum by comparing the current difference with the average difference over past few periods.
To simplify we check the current "EMA of 12 periods – EMA of 26 periods" and we compare it with the average "EMA of 12 periods – EMA of 26 periods" for the past few periods. In our case i.e. (MACD 26, 12, 9) it is the average of the differences of past 9 periods.
With MACD (26,12,9) what we are calculating is as follows:
- Moving average of closing prices for past 12 periods, say “X”
- Moving average of the closing prices for past 26 periods, say “Y”
- Difference “X-Y” (MACD). If it is positive then it’s a signal for uptrend and if negative than of downtrend.
- Moving average of “X-Y” for past 9 periods, say “Z”
- If MACD line (connecting all “X-Y” points) moves above the trigger or signal line (line connecting all “Z” points) then it would indicate that the current rate of upward momentum has gone higher than the average rate of previous 9 periods. This indicates that the uptrend is increasing or gaining momentum and it may be the time to buy.
Opposite of points 1 to 5 above i.e. when the MACD goes below the signal line would indicate the time to sell.
Summary of Construction
- The main line, sometimes called as MACD fast line, is calculated by taking the difference of two Exponential Moving Averages (EMAs) - popularly the 12 and 26 period EMAs.
- The signal line, sometimes called as the trigger line, is an EMA of the MACD main line. This popularly uses 9 period EMA of the MACD main line.
- The MACD histogram is a bar chart that shows the difference between the two lines (main line and signal line) Mathematically, it is the signal line subtracted from the MACD main line (Histogram = Main Line – Signal Line).
For trading, the main signals we look for are as follows:
- Main line crossing the signal line.
- MACD main line crossing the center line i.e. moving from positive to negative or vice versa.
- Divergence / Convergence.
1) MACD main line crossing signal line (trigger line):
A trading signal is generated when the main line crosses the signal line.
Bullish signal - MACD line moves over the signal line:
A bullish moving average Crossover occurs when the main line moves above its signal line
Such move indicates that the prices are gaining upward momentum. If the MACD was already in positive range, indicating an uptrend, then it would mean that the uptrend is getting stronger. If the MACD was in negative range then it may mean that a reversal or upward correction can be expected. Please check charts 2 & 3 below.
Bearish Signal - MACD line moves below the signal line:
A bearish moving average Crossover occurs when MACD moves below its signal line.
Such move indicates that the recent downward momentum is getting stronger than the previous. This is just opposite to the bullish signal we explained above. In this case if the MACD was already in negative range then it indicates that the existing downtrend is getting stronger. If the MACD was in positive range then it signals the possibilities of a reversal or correction of the existing uptrend. Please check charts 2 & 3 below.
Please keep in mind that MACD works better during a reversal of a trend (uptrend to downtrend or vice-versa) and may tend to give a lot of false signals when the price action is in narrow range.
2) MACD line crossing the center line:
- A Bullish Center line Crossover occurs when the main MACD line moves above the zero/Center line. This gives a signal that momentum has reversed from negative to positive (from downtrend to uptrend).
- A Bearish Center line Crossover occurs when the main line moves below the zero/Center line. This gives a signal that momentum has reversed from positive to negative (from uptrend to downtrend).
Please take a note of the points A to F in the above chart for EUR/USD:
Point A and associated area within the green circle:
The MACD main line moves over the signal line: This gives a “buy” signal or a signal indicating the possibilities of a correction or reversal of the downtrend. Please note that prior to this crossover the MACD was in the negative zone and was representing a bearish market. After this signal was generated the price continued moving upwards.
Point B and associated area within the green circle:
At point “B” the MACD line crosses over the “Center line”. This again signals that an uptrend may start.
Point D and associated area within the red circle:
At point “D” the MACD line moved below the signal line and hence indicated that we could expect a downward correction or even a reversal of the uptrend. Please note at prior to this crossover MACD line was in positive zone and was indicating a bullish market. In case we were already holding a long position for EUR/USD then this signal suggested to close the position. In case we were not holding any bought position before the point "D", we could short-sell the currency pair to benefit from the possible downward move.
Point E and associated area within the red circle:
At point E, the MACD line started crossing over the signal. This singled that the prices might start to go up. This signal did not prove to be a good signal as the MACD line did not really move up sharply.
Please take a note of the areas within the circles in the above charts. Prior to each crossover there has been a divergence. For example before the crossover at point D, the MACD line had started moving downwards sharply. Similarly within the area of point “E”, the MACD line had started moving upwards sharply before the actual crossover took place. In the area “C”, the MACD line started moving down but this move was not sharp. These sharp divergences may also indicate the possible change of the trend.
In MACD analysis it is not only the crossover signals which we need to focus on but we also need to watch the developments of the subsequent highs and lows. When the subsequent high or low points (peaks and valleys) in MACD line are going lower than the previous peaks or lows, it may give a good signal for an emerging down trend. Similarly if the subsequent high and low points in MACD line are going higher than the previous ones, it may give a good signal for an emerging uptrend.
Please check about MACD Histogram to see what is this indicator and how to use it in technical analysis.
Please also check more explanation about MACD Divergence and it's use in trading.
We have also tried to mention about some research on revised MACD trading strategies to avoid number of false trading signals.
You may also like to check some of our trading strategies by combining MACD with RSI and SAR for better trading decisions.
You may also check some good videos about MACD.
We explained Moving Averages for technical analysis in the context of Forex Trading but the same stands good for stock trading or any commodity trading