Moving Average Convergence-Divergence (MACD) - The Complete Guide
Table of Contents
MACD or Moving Average Convergence-Divergence is one of the most popular and widely used technical analysis Indicators. This 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.
MACD indicator is a momentum Oscillator and can be used to determine the momentum of the price action. It 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 indicator 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 prices have been continuously increasing, indicating 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 12, 26, 9. Here “12” is the EMA of previous 12 periods, “26” is the EMA of previous 26 periods. And MACD would be the line constructed by joining the points which we get by deducting the EMA(12) from EMA(26). 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 (12,26, 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 12, 26, 9) it is the average of the differences of past 9 periods.
With MACD (12,26,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.
Like any technical indicators MACD is also used to indicate the expected price-action based on the price-action of the past. The standard period settings of MACD are nothing but the trading time units excluding the day offs. The settings denote the following:
- 12= 12 days of two trading weeks considering 6 days week.
- 26 = 26 days of a trading month considering 6 days week.
- 9= 9 days or one and a half trading week
In the past a working week used to be 6 days with only Sunday off. In the modern times when we have a 5-day trading week with Saturdays and Sundays off. Considering this an argument is justified as to why we should use the old settings? If we consider this argument then the new setting for MACD could be "10, 22, 7" or "10, 22, 8". The trading platforms offer only whole numbers settings and hence we cannot have 7.5 as one and a half weeks.
Rationale behind using old period settings
Technical indicators are not a magic. They work only because people tend to take trading decisions based on the signals generated by the indicators. If we get a bullish signal from MACD and based on that traders around the world start buying then the prices will shot up further because of the demand created. The opposite of this is also true that on receiving a bearish signal the increased short-selling will push the prices further down. The standard settings of MACD considering a trading week of 6 days has been in use for over 4 decades. Traders still use the standard settings for taking their trading decisions and hence there is no reason to argue against that and use different settings. However, let's see a comparison of the standard settings and the possible new settings with 5-day trading week i.e."10, 22, 7".
The above daily Forex chart of USD/JPY is showing MACD (12, 26, 9) and MACD (10, 22, 7). The MACDs of both settings have generated 4 signals which proved to be false and 4 signals which were true. The last signal is indicating a question mark but that had proved to be true later when the price had touched 104.13 on April 4, 2014. Now we observe carefully we would note that the only difference is that the signals by MACD (22, 10, 7) had been coming up slightly earlier that those by MACD (12, 26, 9). The lead time is roughly one period or in the case of the daily chart it is one day. This fact leads to another argument i.e. why we should not use the new settings as we get the signal early?
Pros and Cons of Early Signals
Not 100% signals by any technical indicators are true. The above chart indicates 50% success ratio. However the true signals could lead to bigger profits than the loss by false signals if the exits were not premature. The early signals may lead to bigger profits if the signals come to be true. On the other hand an early signal may increase the probability of bigger loss if the signal tends to be false.
Another way to look into this is that if the entry signal would be generated early then the exit signal for that trade would also come in early. This may even out the advantages or disadvantages of getting an early signal if the entries and exits are made solely based on the signals generated by MACD.
Conclusion about the period settings
Considering all the above points, it is always better to stick to the standard period settings which are commonly used. There is no point in reinventing the wheel.
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 and Convergence.
MACD main line crossing signal line (trigger line):
A trading signal is generated when the main line crosses the signal line. A crossover indicates a possible reversal of the price-action in the direction of the crossover.
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.
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 R1/R2 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 MACD for technical analysis in the context of Forex trading but the same stands good for stock trading or any commodity trading