Master the core of the king of indicators, MACD trading, with a comprehensive article. A9 expert shares practical insights!
To help the brothers understand better, I specifically added this image.
Before using an indicator, one must trace its essence, and the best way to understand an indicator from its essence is to open the source code of the indicator and read it. Once the source code is opened, all mysterious aspects vanish.
Many brothers like to use the MACD indicator, but many of the methods regarding MACD in the market are based on assumptions. Today, we have invited an A9 expert to break down and thoroughly discuss MACD with everyone.
1. What is a moving average?
To understand the MACD indicator, you must first understand moving averages.
The so-called moving average is the average value of past stock prices and has no predictive significance. For example, the 5-day moving average is a line formed by connecting the average closing prices of the last five days.
For example (using the stock market as an easier analogy, the crypto space is only suitable for top cryptocurrencies), if the stock price was typically 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 tilt upwards, while the long-term moving average will not be significantly affected and will be relatively sluggish.
Because the short-term moving average is the average of fewer numbers, a sudden appearance of a large number has a significant impact on the average. In contrast, the long-term moving average is the average of many numbers, and the occasional appearance of a 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 gradually follows up; when the stock price falls, the moving average also gradually follows down.
The role of moving averages is to indicate the direction of price movement; they are trend indicators and cannot tell you what will happen in the future, but rather what the current trend is. For many people, moving averages are not much more insightful than visually analyzing candlestick charts.
Does the moving average represent the average holding cost over a certain period?
People often say that the 10-day moving average represents the average cost of buyers over these 10 days, but this is inaccurate because it does not take into account the volume of transactions.
If a certain stock has a huge volume on a particular day, it indicates that there were many buyers that day. Therefore, simply adding the closing prices to calculate the average is obviously not representative of the average holding cost for buyers.
Some people say that once the moving averages intertwine, it is necessary to pay close attention, as there will soon be a significant rise or fall. Is that really the case?
In fact, after understanding the essence of the moving average, the moving average winding is not mysterious at all, as long as the stock price fluctuates in a narrow range for a long enough time, the long-term and short-term moving averages will definitely be entangled. Even if you don't look at the moving average, you know that stock price fluctuations are brewing a wave of trend market, and stock price fluctuations are only up or down.
Some people also say that the entanglement of moving averages represents the alignment of long-term and short-term buyer costs, which is inaccurate because it does not take into account the volume factor.
The simple average of stock prices 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 algorithm for the simple moving average (MA) is to sum the closing prices of the most recent 26 days and calculate the average value, where each day's closing price has an equal impact on the calculation of the average.
But we calculate the moving average to get a clearer view of the trend (which can actually be seen with the naked eye); the closing prices that are closer to the current time should better reflect the ongoing trend of the stock price.
Therefore, someone compiled the EMA moving average, where the closing prices closer to the current time have a greater weight in the calculation of the average.
Actually, I don't think the difference is significant. When you try to make the moving average more sensitive to price fluctuations, the probability of false signals increases. If any readers find this hard to understand, you can simply think of EMA as a regular moving average.
2. How does MACD come about? Every software has it. To understand the MACD indicator, you 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 the 12th and 26th, because in the past, there were 6 trading days per week, which meant half a month was 12 days, and a month was 26 days. Although there are now 5 trading days a week, the parameters have gradually become habitual, and the technical parameters that everyone looks at are often more important.
The absolute value of DIF represents 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 uptrend, 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 downtrend, 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 moving average and the 26-day moving average; when the DIF crosses below the 0 axis, it indicates a dead cross between the 12-day moving average and the 26-day moving average.
Is a golden cross a buy signal and a death cross a sell signal?
We still need to return to the essence of moving averages, because of the formula used to calculate the average, short-term moving averages are more sensitive to price changes. For example, if the stock price has been 10 yuan for the past 20 days and suddenly rises to 11 yuan today, then the value of the 5-day moving average today would be 10.2 yuan, and the value of the 10-day moving average would be 10.1 yuan. This is represented on the chart as a golden cross between the 5-day and 10-day moving averages.
If readers still don't understand, they can calculate it themselves and draw a few moving averages to make it clear.
So, is the golden cross caused by the short-term rise in stock prices a buy signal?
The buy signal of a golden cross is only valid if the stock price continues to rise in the future. If the stock price falls in the future, the golden cross is a false signal. In other words, in a trending market, golden crosses and death crosses are effective buy and sell signals, but in a choppy market, both golden crosses and death crosses are basically false signals.
There are many false signals from the moving average indicators, but one thing is certain: before a stock price begins to rise in a trend, there will definitely be a golden cross of the moving averages; before a stock price begins to fall in a trend, there will also definitely be a death cross of the moving averages.
Can you tolerate the small losses caused by countless false signals when buying and selling according to the golden cross and death cross signals? Because we cannot predict whether the future will be a sideways market or a trending market.
Next, let's continue talking about DIF.
The larger the absolute value of DIF, the greater the gap between the short-term and long-term moving averages, which means that the short-term rise or fall of stock prices is accelerating.
Stock prices cannot only rise without falling, nor can they only fall without rising. Short-term large fluctuations are also not sustainable in the long run; stock prices will inevitably experience fluctuations or corrections.
For this reason, DIF fluctuates around the zero axis, indicating that MACD has the characteristics of an oscillating indicator, essentially a repeated interpretation of human greed and fear.
Another concept that is often mentioned is MACD divergence at the top and bottom.
The image below shows two short-term top divergences, where the stock price is rising, but the DIF is continuously declining, meaning that as the stock price rises, the distance between the two moving averages has not reached a new high.
Generally speaking, the appearance of a top divergence during an uptrend indicates that a short-term decline may occur. This is because a strong rally should be characterized by continuous inflow of market capital, with stock prices rising faster and faster, as reflected in the moving averages by the increasing distance between the short-term and long-term moving averages.
However, if the distance between the short-term and long-term moving averages becomes smaller, it indicates that the upward momentum is weakening. Although the stock price still appears to be rising, it could start to decline at any moment. This is the essence of the MACD divergence warning that the stock price may fall.
Now everyone should be able to understand the essence of a bearish divergence, but moving averages always represent the past and cannot be used to predict the future. The chart below is an example of a failed bearish divergence; after all, the past upward momentum is getting weaker, and if a positive development occurs in the future, it will still continue to surge.
There is not much to say about bullish divergence; it is essentially the opposite of bearish divergence, indicating a weakening of the downtrend. Similarly, a weakening downtrend does not necessarily mean that it will not continue to fall.
(2) DEA: The moving average line of the DIF value, generally the software defaults to a 9-day average.
Why is a moving average line of the DIF set?
The moving average is a way of thinking; we are not sensitive to numerical fluctuations with the naked eye, but if we compare the current value with the average value, we can more vividly perceive the changes in the value.
Similar to the idea of the average stock price line mentioned above, DEA is the 9-day average value of DIF, which means it is more sluggish to the single-day changes of DIF. If DIF crosses above DEA (golden cross), it indicates that the recent DIF is increasing; if DIF crosses below DEA (death cross), it indicates that the recent DIF is decreasing.
When DIF is above the zero axis:
The cross of DIF and DEA indicates that DIF is increasing, meaning the distance between the short-term and long-term moving averages of the stock price is widening, and the upward momentum of the stock price is becoming stronger.
The DIF and DEA have formed a dead cross, which means that the DIF is decreasing, indicating that the distance between the long-term and short-term moving averages of the stock price is getting smaller. The upward momentum of the stock price is currently weakening.
When the DIF is below the zero axis:
The DIF and DEA have formed a golden cross, at which point the DIF is a negative value. This means that the absolute value of the DIF is decreasing, indicating that the distance between the long-term and short-term moving averages of the stock price is getting smaller, and the downward momentum of the stock price is weakening.
The DIF and DEA have crossed, at this time the DIF is a negative value, which means that the absolute value of the DIF is increasing, indicating that the distance between the short-term and long-term moving averages of the stock price is widening, and the downward momentum of the stock price is becoming stronger.
Whether it's the golden cross or death cross of moving averages, or the golden cross or death cross of MACD, they all describe the past price trends. If the future price trends continue the characteristics of the past, then the buy and sell signals will be very accurate; but if the future price trends do not continue the characteristics of the past, then the buy and sell signals will be false signals.
In other words, the golden cross and death cross are trend indicators and are not applicable in a sideways market. The key is that we can only determine whether the market is trending or sideways once the stock price has moved.
(3) Red bars and green bars: (DIF-DEA)*2 is the value of the bars, with red bars representing positive values and green bars representing negative values.
Many people may start to get dizzy when they see this, and it is precisely because the MACD is designed to be more complex that most of the usage outside is wrong and is taken for granted.
DIF is the difference between the 12-day moving average and the 26-day moving average, indicating the magnitude of the distance (opening) between the short-term and long-term moving averages. The larger the absolute value of DIF, the greater the distance between the short-term and long-term moving averages, representing a stronger upward or downward momentum.
The meaning of the red and green bars is similar to the principle of DIF. MACD indicates two aggregations and divergences: one is DIF, which represents the aggregation and divergence of the short-term moving average and the long-term moving average; the other is the MACD red and green bars, which indicate 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 intensity of the DIF changes, we also need to examine the difference between the DIF and DEA.
The value of the red and green bars is the difference between DIF and DEA. The longer the red and green bars, the greater the distance between DIF and DEA, indicating a stronger upward or downward momentum.
Today's article is a bit lengthy, and if it goes on any longer, there may be very few people who can keep reading. 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 DIF and DEA; when a green bar turns into a red bar, it corresponds to the golden cross of DIF and DEA.
In conclusion, can MACD predict the market?
No!
MACD is a description of the current stock price trend. Experienced traders can draw the same conclusions as MACD just by looking at the raw candlestick chart. To give a somewhat inaccurate analogy, looking directly at the candlestick chart is somewhat like a doctor using a stethoscope to listen to your heartbeat, while MACD is like a printed electrocardiogram that categorizes different heartbeats.
There is a classic "Russell's Chicken" story: In a farm, there was a chicken that the farmer fed a lot of delicious food every morning at dawn, making it grow plump and white. This went on for a few months. One day, the farmer came again, but this time he did not feed it; instead, he killed it because that day was Thanksgiving.
In trading, some people do not understand the essence of indicators. They start to summarize patterns upon seeing certain phenomena, ultimately becoming like the Russell chicken that dies from relying solely on inductive reasoning. Remember, when you want to use a certain indicator, please first understand how it came about.
This article is not about teaching you to use indicators, but rather about breaking superstitions. The root of superstition is ignorance.
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
Master the core of the king of indicators, MACD trading, with a comprehensive article. A9 expert shares practical insights!
To help the brothers understand better, I specifically added this image.
Before using an indicator, one must trace its essence, and the best way to understand an indicator from its essence is to open the source code of the indicator and read it. Once the source code is opened, all mysterious aspects vanish.
Many brothers like to use the MACD indicator, but many of the methods regarding MACD in the market are based on assumptions. Today, we have invited an A9 expert to break down and thoroughly discuss MACD with everyone.
1. What is a moving average?
To understand the MACD indicator, you must first understand moving averages.
The so-called moving average is the average value of past stock prices and has no predictive significance. For example, the 5-day moving average is a line formed by connecting the average closing prices of the last five days.
For example (using the stock market as an easier analogy, the crypto space is only suitable for top cryptocurrencies), if the stock price was typically 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 tilt upwards, while the long-term moving average will not be significantly affected and will be relatively sluggish.
Because the short-term moving average is the average of fewer numbers, a sudden appearance of a large number has a significant impact on the average. In contrast, the long-term moving average is the average of many numbers, and the occasional appearance of a 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 gradually follows up; when the stock price falls, the moving average also gradually follows down.
The role of moving averages is to indicate the direction of price movement; they are trend indicators and cannot tell you what will happen in the future, but rather what the current trend is. For many people, moving averages are not much more insightful than visually analyzing candlestick charts.
Does the moving average represent the average holding cost over a certain period?
People often say that the 10-day moving average represents the average cost of buyers over these 10 days, but this is inaccurate because it does not take into account the volume of transactions.
If a certain stock has a huge volume on a particular day, it indicates that there were many buyers that day. Therefore, simply adding the closing prices to calculate the average is obviously not representative of the average holding cost for buyers.
Some people say that once the moving averages intertwine, it is necessary to pay close attention, as there will soon be a significant rise or fall. Is that really the case?
In fact, after understanding the essence of the moving average, the moving average winding is not mysterious at all, as long as the stock price fluctuates in a narrow range for a long enough time, the long-term and short-term moving averages will definitely be entangled. Even if you don't look at the moving average, you know that stock price fluctuations are brewing a wave of trend market, and stock price fluctuations are only up or down.
Some people also say that the entanglement of moving averages represents the alignment of long-term and short-term buyer costs, which is inaccurate because it does not take into account the volume factor.
The simple average of stock prices 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 algorithm for the simple moving average (MA) is to sum the closing prices of the most recent 26 days and calculate the average value, where each day's closing price has an equal impact on the calculation of the average.
But we calculate the moving average to get a clearer view of the trend (which can actually be seen with the naked eye); the closing prices that are closer to the current time should better reflect the ongoing trend of the stock price.
Therefore, someone compiled the EMA moving average, where the closing prices closer to the current time have a greater weight in the calculation of the average.
Actually, I don't think the difference is significant. When you try to make the moving average more sensitive to price fluctuations, the probability of false signals increases. If any readers find this hard to understand, you can simply think of EMA as a regular moving average.
2. How does MACD come about?
Every software has it. To understand the MACD indicator, you 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 the 12th and 26th, because in the past, there were 6 trading days per week, which meant half a month was 12 days, and a month was 26 days. Although there are now 5 trading days a week, the parameters have gradually become habitual, and the technical parameters that everyone looks at are often more important.
The absolute value of DIF represents 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 uptrend, 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 downtrend, 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 moving average and the 26-day moving average; when the DIF crosses below the 0 axis, it indicates a dead cross between the 12-day moving average and the 26-day moving average.
Is a golden cross a buy signal and a death cross a sell signal?
We still need to return to the essence of moving averages, because of the formula used to calculate the average, short-term moving averages are more sensitive to price changes. For example, if the stock price has been 10 yuan for the past 20 days and suddenly rises to 11 yuan today, then the value of the 5-day moving average today would be 10.2 yuan, and the value of the 10-day moving average would be 10.1 yuan. This is represented on the chart as a golden cross between the 5-day and 10-day moving averages.
If readers still don't understand, they can calculate it themselves and draw a few moving averages to make it clear.
So, is the golden cross caused by the short-term rise in stock prices a buy signal?
The buy signal of a golden cross is only valid if the stock price continues to rise in the future. If the stock price falls in the future, the golden cross is a false signal. In other words, in a trending market, golden crosses and death crosses are effective buy and sell signals, but in a choppy market, both golden crosses and death crosses are basically false signals.
There are many false signals from the moving average indicators, but one thing is certain: before a stock price begins to rise in a trend, there will definitely be a golden cross of the moving averages; before a stock price begins to fall in a trend, there will also definitely be a death cross of the moving averages.
Can you tolerate the small losses caused by countless false signals when buying and selling according to the golden cross and death cross signals? Because we cannot predict whether the future will be a sideways market or a trending market.
Next, let's continue talking about DIF.
The larger the absolute value of DIF, the greater the gap between the short-term and long-term moving averages, which means that the short-term rise or fall of stock prices is accelerating.
Stock prices cannot only rise without falling, nor can they only fall without rising. Short-term large fluctuations are also not sustainable in the long run; stock prices will inevitably experience fluctuations or corrections.
For this reason, DIF fluctuates around the zero axis, indicating that MACD has the characteristics of an oscillating indicator, essentially a repeated interpretation of human greed and fear.
Another concept that is often mentioned is MACD divergence at the top and bottom.
The image below shows two short-term top divergences, where the stock price is rising, but the DIF is continuously declining, meaning that as the stock price rises, the distance between the two moving averages has not reached a new high.
Generally speaking, the appearance of a top divergence during an uptrend indicates that a short-term decline may occur. This is because a strong rally should be characterized by continuous inflow of market capital, with stock prices rising faster and faster, as reflected in the moving averages by the increasing distance between the short-term and long-term moving averages.
However, if the distance between the short-term and long-term moving averages becomes smaller, it indicates that the upward momentum is weakening. Although the stock price still appears to be rising, it could start to decline at any moment. This is the essence of the MACD divergence warning that the stock price may fall.
Now everyone should be able to understand the essence of a bearish divergence, but moving averages always represent the past and cannot be used to predict the future. The chart below is an example of a failed bearish divergence; after all, the past upward momentum is getting weaker, and if a positive development occurs in the future, it will still continue to surge.
There is not much to say about bullish divergence; it is essentially the opposite of bearish divergence, indicating a weakening of the downtrend. Similarly, a weakening downtrend does not necessarily mean that it will not continue to fall.
(2) DEA: The moving average line of the DIF value, generally the software defaults to a 9-day average.
Why is a moving average line of the DIF set?
The moving average is a way of thinking; we are not sensitive to numerical fluctuations with the naked eye, but if we compare the current value with the average value, we can more vividly perceive the changes in the value.
Similar to the idea of the average stock price line mentioned above, DEA is the 9-day average value of DIF, which means it is more sluggish to the single-day changes of DIF. If DIF crosses above DEA (golden cross), it indicates that the recent DIF is increasing; if DIF crosses below DEA (death cross), it indicates that the recent DIF is decreasing.
When DIF is above the zero axis:
The cross of DIF and DEA indicates that DIF is increasing, meaning the distance between the short-term and long-term moving averages of the stock price is widening, and the upward momentum of the stock price is becoming stronger.
The DIF and DEA have formed a dead cross, which means that the DIF is decreasing, indicating that the distance between the long-term and short-term moving averages of the stock price is getting smaller. The upward momentum of the stock price is currently weakening.
When the DIF is below the zero axis:
The DIF and DEA have formed a golden cross, at which point the DIF is a negative value. This means that the absolute value of the DIF is decreasing, indicating that the distance between the long-term and short-term moving averages of the stock price is getting smaller, and the downward momentum of the stock price is weakening.
The DIF and DEA have crossed, at this time the DIF is a negative value, which means that the absolute value of the DIF is increasing, indicating that the distance between the short-term and long-term moving averages of the stock price is widening, and the downward momentum of the stock price is becoming stronger.
Whether it's the golden cross or death cross of moving averages, or the golden cross or death cross of MACD, they all describe the past price trends. If the future price trends continue the characteristics of the past, then the buy and sell signals will be very accurate; but if the future price trends do not continue the characteristics of the past, then the buy and sell signals will be false signals.
In other words, the golden cross and death cross are trend indicators and are not applicable in a sideways market. The key is that we can only determine whether the market is trending or sideways once the stock price has moved.
(3) Red bars and green bars: (DIF-DEA)*2 is the value of the bars, with red bars representing positive values and green bars representing negative values.
Many people may start to get dizzy when they see this, and it is precisely because the MACD is designed to be more complex that most of the usage outside is wrong and is taken for granted.
DIF is the difference between the 12-day moving average and the 26-day moving average, indicating the magnitude of the distance (opening) between the short-term and long-term moving averages. The larger the absolute value of DIF, the greater the distance between the short-term and long-term moving averages, representing a stronger upward or downward momentum.
The meaning of the red and green bars is similar to the principle of DIF. MACD indicates two aggregations and divergences: one is DIF, which represents the aggregation and divergence of the short-term moving average and the long-term moving average; the other is the MACD red and green bars, which indicate 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 intensity of the DIF changes, we also need to examine the difference between the DIF and DEA.
The value of the red and green bars is the difference between DIF and DEA. The longer the red and green bars, the greater the distance between DIF and DEA, indicating a stronger upward or downward momentum.
Today's article is a bit lengthy, and if it goes on any longer, there may be very few people who can keep reading. 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 DIF and DEA; when a green bar turns into a red bar, it corresponds to the golden cross of DIF and DEA.
In conclusion, can MACD predict the market?
No!
MACD is a description of the current stock price trend. Experienced traders can draw the same conclusions as MACD just by looking at the raw candlestick chart. To give a somewhat inaccurate analogy, looking directly at the candlestick chart is somewhat like a doctor using a stethoscope to listen to your heartbeat, while MACD is like a printed electrocardiogram that categorizes different heartbeats.
There is a classic "Russell's Chicken" story: In a farm, there was a chicken that the farmer fed a lot of delicious food every morning at dawn, making it grow plump and white. This went on for a few months. One day, the farmer came again, but this time he did not feed it; instead, he killed it because that day was Thanksgiving.
In trading, some people do not understand the essence of indicators. They start to summarize patterns upon seeing certain phenomena, ultimately becoming like the Russell chicken that dies from relying solely on inductive reasoning. Remember, when you want to use a certain indicator, please first understand how it came about.
This article is not about teaching you to use indicators, but rather about breaking superstitions.
The root of superstition is ignorance.
Let's encourage each other!