The principle and calculation method of the 2021 MACD indicator
The MACD indicator is based on the construction principle of the moving average, smoothing the closing price of the stock price, and then calculating the arithmetic mean. A trend indicator. Below is the principle and calculation method of the MACD indicator compiled by the editor. I hope it can be helpful to you.
The principle and calculation method of the MACD indicator
The calculation method of the MACD indicator
In the application of MACD, first calculate the fast moving average (i.e. EMA1) and The slow moving average (i.e. EMA2) uses these two values ??as the basis for measuring the dispersion value (DIF) between the two (fast and slow lines), and then finds the N-period smoothed moving average of DIF DEA (also called MACD, DEM) line.
Take the parameter of EMA1 as the 12th, the parameter of EMA2 as the 26th, and the parameter of DIF as the 9th as an example to see the calculation process of MACD
1. Calculate the moving average (EMA)
The calculation formula of 12-day EMA is
EMA(12)=previous day EMA(12)×11/13+today’s closing price×2/13
The calculation formula of 26-day EMA is
EMA(26)=previous day EMA(26)×25/27+today’s closing price×2/27
2. Calculate the dispersion value (DIF)
DIF=Today’s EMA(12)-Today’s EMA(26)
3. Calculate the 9-day EMA of DIF
Based on The dispersion value calculates its 9-day EMA, that is, the average dispersion value, which is the required MACD value. In order not to be confused with the original name of the indicator, this value is also called DEA or DEM.
Today's DEA (MACD) = previous day's DEA × 8/10 + today's DIF × 2/10
The calculated values ??of DIF and DEA are both positive or negative. .
Theoretically, in a sustained upward trend, the 12-day EMA line is above the 26-day EMA line, and the positive dispersion value (+DIF) will become larger and larger; conversely, in a downward trend, The mid-dispersion value may become negative (-DIF) and become larger and larger. When the market starts to improve, the positive and negative dispersion values ??will shrink. The indicator MACD uses the cross signal of the positive and negative dispersion values ??(±DIF) and the N-day average line of the dispersion value (N-day EMA) as the basis for buying and selling signals, that is, again based on the intersection principle of fast and slow moving lines. Analyze buy and sell signals. In addition, the MACD indicator has an auxiliary indicator on the stock market software-BAR columnar line. Its formula is: BAR=2×(DIF-DEA). We can still use the contraction of BAR columnar line to determine the timing of buying and selling.
The dispersion value DIF and the dispersion average DEA are the main tools for studying and judging MACD. The calculation method is relatively cumbersome. Since these calculated values ??are currently automatically completed by computers on stock market analysis software, investors only need to understand its calculation process, and more importantly, master its research and judgment function. In addition, like the calculation of other indicators, due to the different calculation periods selected, the MACD indicator also includes various types such as daily MACD indicator, weekly MACD indicator, monthly MACD indicator, yearly MACD indicator and minute MACD indicator. The daily MACD indicator and weekly MACD indicator are often used for stock market research and judgment. Although their calculation values ??are different, the basic calculation method is the same.
In practice, connecting DIF and DEA (MACD) at each point will form two fast (short-term) and slow (long-term) lines moving up and down the zero axis, which are MACD picture.
It is not that simple to use MACD to use the golden cross on the axis and the dead cross on the axis below. Rely on the formula. In actual practice, you will find that 50% are accurate and 50% are wrong. Any indicator of the rising stock will be correct when compared. In actual practice, This is not the case in China. My usage is to add a time period to MAcD. On the red column axis of MACD, if it is close to the 20 line, the chance of success is high, and a stop loss should be made. The stop loss is to break the 20 line or the green column. Let’s compare the Shanghai Composite Index since it dropped from over 5,000 points. If there is a green column on the MACD axis, short moving averages cannot be used, and the 40 or 60 lines must be used. If it breaks the 60 line, it is recommended to exchange stocks. This stock can only be paid attention to if the stock has a red column and goes above the 20 line again.
The construction principle of MACD and
The MACD indicator is a trend indicator based on the construction principle of moving average and smoothing the closing price (calculating the arithmetic mean). It mainly consists of two parts, namely the positive and negative difference (DIF) and the difference and similarity average (DEA). Among them, the positive and negative difference is the core and DEA is the auxiliary. DIF is the difference between the fast smoothed moving average (EMA1) and the slow smoothed moving average (EMA2). In the existing technical analysis software, the commonly used parameters of MACD are 12 for the fast smoothed moving average and 26 for the slow smoothed moving average. In addition, MACD also has an auxiliary indicator-the columnar line (BAR). In most technical analysis software, the columnar lines are colored, green below the 0 axis, and red above the 0 axis. The former represents a weak trend, and the latter represents a strong trend.
Let’s talk about the basic principles that should be followed when using the MACD indicator:
1. When DIF and DEA are above the 0 axis, it is a long market, and the DIF line goes from bottom to bottom. When it crosses the DEA line, it is a buy signal. When the DIF line crosses the DEA line from top to bottom, if the values ????of the two lines are still running above the 0 axis, it can only be regarded as a short-term decline, but the trend turning point cannot be determined. At this time, whether to sell requires the help of other indicators. judge.
2. When DIF and DEA are below the 0 axis, it is a short market. When the DIF line crosses the DEA line from top to bottom, it is a sell signal. When the DIF line crosses the DEA line from bottom to top, if the values ??of the two lines are still running below the 0 axis, it can only be regarded as a short rebound and cannot be determined. When the trend turns, whether to buy at this time requires comprehensive judgment with the help of other indicators.
3. The columnar lines shrink and expand. Generally speaking, the continued contraction of the columnar line indicates that the strength of the trend operation is gradually weakening. When the color of the columnar line changes, the trend has definitely turned. However, in the use of some MACD indicators with short time periods, this view cannot be completely established.
4. Form and divergence. The MACD indicator also emphasizes patterns and divergence phenomena. When the DIF line of the MACD indicator and the MACD line form a high bearish pattern, such as a head and shoulders top, double head, etc., you should remain vigilant; and when the DIF line and the MACD line of the MACD indicator form a low bullish pattern, you should consider buying. . When judging the form, the DIF line is the main one and the MACD line is the supplement. When the price continues to rise, and the MACD indicator moves lower than the wave after wave, it means that the top divergence appears, indicating that the price may turn downward soon. When the price continues to decrease, the MACD indicator moves out of a downward trend. When the wave is higher than the previous wave, it means the emergence of bottom divergence, indicating that the price will soon end its decline and turn around to rise.
5. The market indicators of cowhide will be distorted. When the price does not move from top to bottom or bottom to top, but keeps moving in the horizontal direction, we call it a bull market. At this time, false signals will be generated in the MACD indicator. The difference between the indicator DIF line and the MACD line Crossovers will be very frequent, and at the same time, the contraction and expansion of columnar lines will also occur frequently, and the color will often change from green to red or from red to green. At this time, the MACD indicator is in a distorted state, and its use value is correspondingly reduced.
Overview of the MACD indicator
MACD: exponential smoothing moving average, based on the construction principle of the double exponential moving average, subtracting the slow exponential from the fast exponential moving average (EMA12) The moving average (EMA26) is used to obtain the fast line DIF, and then 2×(9-day weighted moving average DEA of the fast line DIF-DIF) is used to obtain the MACD column, that is, after smoothing the closing price (calculating the arithmetic mean) A trend indicator.
MACD (Moving Average Convergence and Divergence) was proposed by Geral Appel in 1970, using the aggregation between the short-term (commonly 12-day) exponential moving average of closing prices and the long-term (commonly 26-day) exponential moving average. It is a technical indicator used to judge the timing of buying and selling based on separation conditions.
Normally, MACD is a moving average fluctuation indicator, but it is not an ordinary moving average. Two graph lines are displayed in the MACD graph, one is a solid line, which is the MACD line. The other line is the dotted line (Triggerline) which is the moving average of MACD. The gap between the MACD line and the Trigger line can be drawn as a columnar vertical line chart (Oscillators), with zero (0) as the central axis. The positive or negative of the columnar vertical line chart (Oscillators) indicates which one is the MACD line or the Trigger line. Which one is above and which one is below can be used as the best time to judge the transaction. The meaning of MACD is basically the same as that of the double moving average, that is, the dispersion and aggregation of the fast and slow moving averages represent the current long and short status and the possible development trend of the stock price, but it is more convenient to read. When MACD turns from negative to positive, it is a buy signal. When MACD turns from positive to negative, it is a sell signal. When MACD changes at a large angle, it means that the gap between the fast moving average and the slow moving average widens very quickly, which represents a change in the general market trend.
The importance of the MACD indicator is reflected in:
(1) The MACD indicator is the default preferred indicator in major stock and futures market software.
(2) The MACD indicator is of course the most used indicator and is the most effective and practical indicator that has been tested in history.
(3) The MACD indicator is an oscillator calculated from the trend moving average indicator EMA, and has good application effects on trends and oscillating markets.
(4) The divergence of the MACD indicator is considered to be one of the most useful technical analysis methods of "buying the bottom and escaping the top".
(5) The MACD indicator is the preferred entry-level indicator and is the beginning of many investors’ entry into indicator research. Moreover, many people eventually return to the indicator after being exposed to other indicators, or even creating their own indicators or using combinations of indicators. Go back to basics and still use the ultimate indicator.
As the saying goes, "I searched for her thousands of times in the crowd, but suddenly I looked back and found that person in the dim light."
(6) The MACD indicator is one of the most commonly used entry and exit basis for systematic traders and is widely used. Determine buying and selling points as well as market long and short conditions.
The MACD indicator is based on the construction principle of the moving average, smoothing the closing price of the trend price, and then calculating the arithmetic mean. It is a trend indicator. Theoretically, operations can be performed based on the position of DIF and MACD, the crossover situation, the scaling of the red and green columns, and the divergence from the K line.
The MACD indicator is one of the most extensive analysis tools familiar to most investors in the market. However, when using it specifically, investors may feel that the use of the MACD indicator is accurate, effective, and reliable. There are a lot of confusions in terms of operation. Sometimes you will find that when you use the MACD indicator analysis methods and techniques learned from books to judge the stock trend, the conclusions drawn are often very different from the actual trend.
The main reason is that the discussion of MACD in most books on stock market technical analysis in the market is only limited to the superficial level, and only introduces the general analysis principles and methods of MACD, while the connotation and meaning of MACD analysis indicators are Analytical techniques vary widely.
The following introduces the general research and judgment skills and analysis methods of the MACD indicator, and elaborates on the various principles and functions of MACD.
The general research and judgment standards of MACD indicators mainly revolve around the two moving averages, fast and slow, as well as the red and green column lines and their shapes. The general analysis method mainly includes four major analysis aspects: DIF and MACD values ??and their positions, the intersection of DIF and MACD, the shrinkage of the red column and the shape of the MACD graph.