Master the core of the MACD trading indicator in one article, with practical sharing from A9 experts!
To help my brothers understand better, I specially supplemented this diagram.
Before applying an indicator, one must trace back to its essence, and the best way to understand an indicator at its core is to open the source code to read. Once the source code is opened, all mysterious elements vanish into thin air.
I have noticed that many brothers like to use the MACD indicator, but many of the applications of MACD on the market are based on assumptions. Today, I have invited a master from A9 to break down MACD and discuss it thoroughly with everyone.
1. What is a moving average?
To understand the MACD indicator, one must first understand the moving averages.
The so-called moving average is just the average value of past stock prices and has no predictive significance. For example, the 5-day moving average is simply the average of the closing prices over the last five days connected together.
For example, (here we use the stock market for easier understanding; the cryptocurrency market is only suitable for leading coins) if past stock prices were in the range of 5-6 yuan, then the moving average would also be in that range. Suddenly, one day the closing price rises to 7 yuan, then the short-term moving average will slightly rise, while the long-term moving average will be less affected and will be relatively sluggish.
Because the short-term moving average is the average of fewer numbers, a sudden large number will significantly affect the average. In contrast, the long-term moving average is the average of many numbers; an occasional large number does not significantly affect the average.
It is the stock price that determines the direction of the moving average, not the moving average that determines the direction of the stock price. When the stock price rises, the moving average slowly follows; when the stock price falls, the moving average also slowly follows downward.
The function of the moving average is to indicate the direction of price movement, belonging to trend indicators. It cannot tell you what will happen in the future, but it tells you what the current trend is. For many people, moving averages are not much smarter than looking at candlestick charts with the naked eye.
Does the moving average represent the average holding cost for a certain period?
People often say that the 10-day moving average represents the average cost for buyers over those 10 days, but this is inaccurate because it does not take volume into account.
When a certain stock has a huge volume on a certain day, it indicates that many buyers entered that day. Therefore, simply adding up the closing prices to calculate the average does not accurately represent the average holding cost for the buyers.
Some people also say that once the moving averages entangle, it needs close attention because a sharp rise or fall will appear soon. Is this really the case?
In fact, after understanding the essence of moving averages, the entanglement of moving averages is not mysterious at all. As long as the stock price oscillates in a narrow range for a sufficiently long time, the short-term and long-term moving averages will definitely entangle together. Even if you do not look at the moving averages, you know that the stock price oscillation is brewing a trend, and apart from oscillation, the stock price can only rise or fall.
Some also say that the entanglement of moving averages indicates that the buyer costs of short-term and long-term tend to be consistent, which is inaccurate because it does not consider volume factors.
The simple average of the stock price is called the MA moving average, while the moving average used in calculating the MACD indicator is the EMA.
Taking the 26-day moving average as an example, the calculation method for the ordinary moving average (MA) is to add up the closing prices of the most recent 26 days to find the average; the impact of past daily closing prices on the average is equally significant.
However, we calculate moving averages to see the trends more intuitively (in fact, the naked eye can also see it). The closer the closing price is to the current time, the more it should reflect the trend that the stock price is undergoing.
Thus, someone compiled the EMA moving average, where the closing prices closer to the current time have greater weight in calculating the average.
Actually, I think the difference is not significant. When you try to make the moving average more sensitive to stock price fluctuations, the probability of false signals increases. If readers do not quite understand this, they can simply treat EMA as a regular moving average.
2. How is MACD derived?
Every software has it; to understand the MACD indicator, one must first grasp the three key elements: DIF, DEA, and red and green bars.
(1) DIF = 12-day EMA - 26-day EMA.
Most software defaults to parameters of 12 and 26 days, as previously there were 6 trading days a week, making half a month 12 days and a month 26 days. Although a week now has become 5 trading days, the parameters have gradually formed a habit, and the technical parameters everyone looks at are often more important.
The size of the absolute value of the DIF represents the size of the distance (opening) between the long-term and short-term moving averages.
When the 12-day moving average is above the 26-day moving average, the stock price is in an upward state, and the DIF is above the 0 axis; when the 12-day moving average is below the 26-day moving average, the stock price is in a downward state, and the DIF is below the 0 axis.
When the DIF crosses above the 0 axis, it indicates a golden cross between the 12-day and 26-day moving averages; when the DIF crosses below the 0 axis, it indicates a death cross between the 12-day and 26-day moving averages.
Is a golden cross of the moving average a buy signal, and a death cross a sell signal?
We must return to the essence of moving averages because, due to the formula used for calculating the average, the short-term moving average is more sensitive to changes in stock prices. For example, if the stock prices over the past 20 days were all 10 yuan, and today the stock price suddenly rises to 11 yuan, then the value of today's 5-day moving average will be 10.2 yuan and the 10-day moving average will be 10.1 yuan, which is reflected in the chart as the golden cross between the 5-day and 10-day moving averages.
If readers still do not understand, try calculating it yourself, and drawing a few moving averages will make it clear.
Then, is the golden cross caused by a short-term stock price rise a buy signal?
Only if the stock price continues to rise in the future will the golden cross buy signal be valid. If the stock price falls in the future, the golden cross is a false signal. In other words, in trending markets, golden crosses and death crosses are effective buy and sell signals, but in sideways markets, they are basically all false signals.
There are many false signals from moving average indicators, but one thing is certain: before a stock price begins a wave of upward trends, there will definitely be a golden cross of the moving averages; likewise, before a stock price begins a downward trend, there will definitely be a death cross of the moving averages.
If you buy and sell according to golden cross and death cross signals, can you tolerate the small losses caused by countless false signals? Because we cannot predict whether the future will be in a sideways market or a trending market.
Next, let's continue discussing the DIF.
The larger the absolute value of the DIF, the larger the opening between the long-term and short-term moving averages, meaning that the short-term stock price increase or decrease is accelerating.
Stock prices cannot only rise without falling, nor can they only fall without rising. A sudden large rise or fall in the short term is also not sustainable in the long run; stock prices will inevitably experience fluctuations or pullbacks.
For this reason, the DIF oscillates around the zero axis, indicating that MACD has the characteristics of an oscillation indicator, essentially a repeated interpretation of human greed and fear.
Another frequently mentioned concept is the MACD top divergence and bottom divergence.
The following diagram shows two short-term top divergences, meaning that the stock price is rising, but the DIF keeps falling, i.e., as the stock price rises, the distance between the two moving averages did not create a new high.
Generally speaking, a top divergence in an upward trend indicates that a short-term decline may occur. A strong upward movement should be reflected in a continuous inflow of market funds, causing the stock price to rise faster, which is represented as the distance between the short-term and long-term moving averages increasing.
But if the distance between the long-term and short-term moving averages is getting smaller, it means that the upward momentum is getting weaker. Although the stock price still appears to be rising, it may start to fall at any time. This is the essence of the MACD top divergence indicating that the stock price may fall.
Now everyone should be able to understand the essence of top divergence, but moving averages always represent the past and cannot be used to predict the future. The following diagram is an example of the failure of top divergence, as past upward momentum weakens; if a good news appears in the future, the stock price may still rise sharply.
Bottom divergence will not be elaborated further; it is the opposite of top divergence and indicates a weakening of downward momentum. Similarly, a weakening of downward momentum does not mean that it will not continue to fall.
(2) DEA: The moving average line of DIF values, usually the software defaults to a 9-day average.
Why is there a moving average line for the DIF?
The average line is a way of thinking. Our naked eye is not sensitive to numerical fluctuations, but if we compare the current value with the average value, we can more vividly perceive the changes in value.
Following the idea of the average stock price mentioned above, DEA is the 9-day average of DIF, meaning it is more sluggish to daily changes in DIF. If the DIF crosses above the DEA (golden cross), it indicates that the recent DIF is increasing; if the DIF crosses below the DEA (death cross), it indicates that the recent DIF is decreasing.
When the DIF is above the zero axis:
When the DIF and DEA form a golden cross, it means that the DIF is increasing, indicating that the distance between the long-term and short-term moving averages is increasing, and the stock price upward momentum is becoming stronger.
When the DIF and DEA form a death cross, it means that the DIF is decreasing, indicating that the distance between the long-term and short-term moving averages is decreasing, and the current upward momentum of the stock price is weakening.
When the DIF is below the zero axis:
When the DIF and DEA form a golden cross, this means that the DIF is negative, indicating that the absolute value of the DIF is decreasing, i.e., the distance between the long-term and short-term moving averages is decreasing, and the downward momentum of the stock price is weakening.
When the DIF and DEA form a death cross, the DIF is negative, indicating that the absolute value of the DIF is increasing, i.e., the distance between the long-term and short-term moving averages is increasing, and the downward momentum of the stock price is becoming stronger.
Whether it is the golden cross or death cross of the moving average or the MACD's golden cross or death cross, they all describe past price trends. If future price trends continue the characteristics of the past, then the buy and sell signals will be very accurate; but if future price trends do not continue the characteristics of the past, then the buy and sell signals will be false signals.
In other words, golden crosses and death crosses are trend indicators and are not applicable in sideways markets. The key is that only after the stock price moves out do we look back to know whether the trend is sideways or trending.
(3) Red and green bars: (DIF - DEA) * 2 is the value of the bars, with red bars being positive and green bars being negative.
Many people may start to feel confused at this point, and it is precisely because the MACD is designed to be relatively complex that most applications outside are incorrect and based on assumptions.
DIF is the difference between the 12-day moving average and the 26-day moving average, representing the size of the distance (opening) between the long-term and short-term moving averages. The larger the absolute value of the DIF, the greater the distance between the long-term and short-term moving averages, indicating stronger upward or downward momentum.
The meanings of the red and green bars are similar to the principle of DIF. MACD indicates two aggregations and divergences: one is DIF, representing the aggregation and divergence of short-term and long-term moving averages; the other is the MACD red and green bars, indicating the aggregation and divergence of DIF and DEA.
By comparing the DIF with its average DEA, we can understand the changes in the DIF. However, to further observe the strength of the DIF changes, we also need to observe the difference between the DIF and DEA.
The values of the red and green bars represent the difference between DIF and DEA; the longer the bars, the greater the distance between DIF and DEA, indicating stronger upward or downward momentum.
Today's article has a lot of content; if I write more, there may be few who can stick around to read. One thing to know about the red and green bars is that when a red bar turns into a green bar, it corresponds to the death cross of the DIF and DEA; when a green bar turns into a red bar, it corresponds to the golden cross of the DIF and DEA.
Finally, let's summarize: Can MACD predict market trends?
No!
MACD describes the current stock price trend; experienced traders can also draw the same conclusions from naked candlestick charts. An inaccurate analogy is that directly looking at candlestick charts is somewhat like a doctor using a stethoscope to listen to your heartbeat, while MACD is the printed electrocardiogram classifying different heartbeats.
There is a classic story about 'Russell's Chicken': There was a chicken on a farm that was fed a lot of good food by the farmer every day at dawn, making it white and plump. After several months, one day the farmer came, but this time he did not feed it; instead, he killed it because it was Thanksgiving.
In trading, some people do not understand the essence of indicators and begin to summarize rules based on certain phenomena, ultimately becoming like the Russell chicken that dies from inductive reasoning. Remember, when you want to use an indicator, please first understand how it came about.
This article does not teach you how to use indicators, but rather breaks the superstition.
The root of superstition is ignorance.
Let's encourage each other!