Directional Movement +DI -DI ADX
+DI and –DI are components of the Average Directional Index (ADX), which is a technical indicator used to identify the strength of a trend. ADX alone is non-directional. The Directional Movement Indicators (DMI) show the actual direction or a trend. When the DMI is plotted on a chart it will plot two lines, +DI and -DI.
+DI is used to measure the presence of an uptrend.
-DI is used to measure the presence of a downtrend.
Average Directional Index (ADX) is an indicator used to determine the strength of a prevailing trend. Its scale measures is zero to one hundred. Low readings typically indicate a weak trend; high values typically indicate a strong trend. ADX cannot be used to determine the direction of a particular trend - only its strength. The +DI and –DI indicators will show the direction of the trend.
Average Directional Index Rating (ADXR) is a plot that represents an average of the current ADX reading and an ADX value x periods ago and is intended to provide early indication of a possible directional change in ADX.
ADX(d, s, z)
(ADX(d, s, z) + ADX(d, s, r)) / 2
(ADXd.s.z + ADXd.s.r) / 2
d is the DI period and must be an integer.
s is the smooth period and must be an integer. This will frequently be the same as the DI period.
z is the offset. An offset of 1 represents 1 bar ago.
r is the sum of the ADXR period and the offset.
The current 14 period +DI can be written as follows.
You can omit the offset parameter in this case since it is for the current vale.
You would need to use the offset parameter if you wanted to reference the value from the previous bar instead of the current bar.
The 14 period -DI for the current bar is similar.
The smooth period used in ADX is usually going to be the same as the DI period. So the current 14 period ADX would be written as follows.
While the value for the previous bar would use the offset parameter.
You can just use the ADXR period for the current value of ADXR. So a 10 period ADXR of a 14 period ADX can be written as follows.
(ADX14.14.10 + ADX14.14.10) / 2
You need to add together the ADXR period and offset to get the offset to use for past values of ADXR however. The 10 period ADXR of the 14 period ADX for the previous bar would add 1 to the offset parameters for the formula used for the current value.
(ADX14.14.11 + ADX14.14.11) / 2
You can read more about the Directional Movement Index on Wikipedia.