MACD consists of positive and negative difference (DIF) and difference mean value (DEA). Of course, the positive and negative difference is the core, and the average is the auxiliary. Firstly, the calculation method of DIF is introduced.
DIF is the difference between fast smma and slow smma, so it is named the positive and negative difference of DIF. The difference between fast and slow is that exponential smoothing uses different parameters. Fast is short-term and slow is long-term. Taking common parameters 12 and 26 as examples, the calculation process of DIF is introduced.
Smma (EMA) is 12 days, then the calculation formula is:
Today's moving average (12)=2* Today's closing /( 12 1)1* Yesterday's moving average/(121)
The slow smma (EMA) is 26 days, and the calculation formula is:
Today's moving average (12)=2* today's closing /(26 1) 25* yesterday's moving average /(26 1)
The above two formulas are exponential smoothing formulas with smoothing factors of 2/ 13 and 2/27 respectively. This method can also be used if other coefficients are selected.
DIF = EMA (12)- EMA (26)
The core of MACD is DIF. A single DIF can also predict the market, but in order to make the signal more reliable, we introduce another indicator DEA.
DEA is the moving average of DIF, that is, the arithmetic average of DIF for several consecutive days. In this way, DEA itself has another parameter, that is, the number of dif in arithmetic average, that is, the number of days.
DIF moving average, like the moving average of closing price, is to eliminate the influence of accidental factors and make the conclusion more reliable.