The calculation method and process of DMI indicators are relatively complex, involving several calculation indicators such as DM, TR, DX, and the operation of four judgment indicators including+DI (PDI -, the same below), DI (MDI, the same below), ADX, and ADXR.
1. The basic program of calculation
Taking the calculation of daily DMI index as an example, the basic procedure for its calculation is mainly as follows:
(1) Compare the highest, lowest, and closing prices generated by daily stock price fluctuations according to certain rules, and calculate the true volatility TR of daily stock price fluctuations+ DI - DI, On the basis of calculating the reference date, accumulate it for a certain number of days to obtain the TR of n days+ DM and DM values.
(2) Divide the rising trend value and falling trend value within n by the actual wave amplitude value within n days, and then calculate the rising indicator+DI - and falling indicator DI for n days.
(3) Calculate the daily trend value DX by comparing the difference between the rising indicator+DI - and the falling indicator DI within n.
(4) Accumulate DX over a certain number of days and average it to obtain the average trend value ADX within n days.
(5) By comparing the ADX of the current day with the ADX of a previous day, calculate the evaluation value ADXR of ADX.
2. The specific process of calculation
(1) Calculate the daily trend value
The daily trend value of the trend index can be divided into three situations: upward trend, downward trend, and no trend. The daily trend value can only be one of the three situations.
A、 Rising trend (+DM)
+DM represents the upward trend value, which is equal to the highest price of the day minus the lowest price of the previous day. The upward trend value must be greater than the absolute value of the current day's lowest price minus the previous day's lowest price, otherwise+DM=0.
B. Declining trend (DM)
DM represents the negative trend change value, which is the downward trend value, and its value is equal to the lowest price of the day minus the lowest price of the previous day. The downward trend value must be greater than the absolute value of the highest price of the day minus the lowest price of the previous day, otherwise DM=0.
C、 No movement
No movement represents the situation where the daily movement value is "zero", that is, the+DM - and DM of the day are both equal to zero. There are two types of stock price fluctuations that may result in no movement. One is when the highest price of the day is lower than the highest price of the previous day and the lowest price of the day is higher than the lowest price of the previous day. The other is when the upward trend value is exactly equal to the downward trend value.
(2) Calculate the true wave amplitude (TR)
TR represents the true wave amplitude, which is the maximum change in the current day's price compared to the previous day's price. The maximum value (absolute value) of the difference between the following three items is taken as the true wave amplitude for the day:
A、 The difference between the highest price of the day and the lowest price of the day.
B、 The difference between the highest price of the day and the closing price of the previous day.
C、 The difference between the lowest price of the day and the closing price of the previous day.
TR is the highest value among A, B, and C
(3) Calculate direction line DI
The directional line DI is an indicator used to measure the rise or fall of stock prices, which is divided into "rising indicator" and "falling indicator". On some stock market analysis software+ DI - represents the upward direction line, DI represents the downward direction line. The calculation method is as follows:
+DI=(DM÷TR)×100
﹣DI=﹣(DM÷TR)×100
To make the directional line have reference value, it is necessary to apply the principle of smooth moving average to accumulate it. Taking the 12 day calculation period as an example, first average the+DM -, DM, and TR within the 12 day period, and the resulting values are+DM12-, DM12, and TR12, respectively, as follows:
+DI(12)=(+DM12÷TR12)×100
﹣DI(12)=﹣(DM12÷TR12)×100
When calculating the+DI12-, DI12 or TR12 on the 13th day, simply use the smooth moving average formula.
For example:
TR12 of the day=11/12 ÷ TR12 of the previous day+TR12 of the day
The value of the upward or downward direction line is always between 0 and 100.
(4) Calculate the average trend ADX
The DX index value can be calculated based on the DI value. The calculation method is to divide the absolute value of the difference between+DI and - DI by the percentage of the sum to obtain the trend index DX. Due to the large fluctuation amplitude of DX, the average trend indicator ADX is generally calculated by smoothing it over a certain period. The specific process is as follows:
DX=(SUM OF DIFFERENCE) ×100
Among them, DI DIF is the absolute value of the price difference between the rising and falling indicators
DI SUM is the sum of the rising and falling indicators
ADX is the moving average of a certain period n of DX.
(5) Calculate the evaluation value ADXR
The ADXR indicator can also be added to the DMI index to facilitate market analysis.
The calculation formula for ADXR is:
ADXR=(ADX of the current day+ADX of the previous day) ÷ 2
Like the calculation of other indicators, due to the different calculation cycles used, DMI indicators also include various types such as daily DMI indicators, weekly DMI indicators, monthly DMI indicators, annual DMI indicators, and minute DMI indicators. The daily DMI index and weekly DMI index are often used for stock market analysis. Although their calculation values are different, the basic calculation method is the same. In addition, with the development of stock market software analysis technology, investors only need to master the basic principles and calculation methods of DMI formation, without the need to calculate the values of indicators. More importantly, they can use DMI indicators to analyze and judge stock market trends.