Legendary trader and author J. Welles Wilder Jr. introduced the directional movement index, or DMI, in 1978. Wilder wanted an indicator that could measure the strength and direction of a price movement so traders could avoid false signals. The DMI is actually two different standard indicators, one negative and one positive, that are plotted as lines on the same chart. A third line, the average directional index, or ADX, is nondirectional but shows movement strength.

There is a different formula used for each of the three indicators. The DMI is built on a ratio of exponential moving averages, or EMAs, of the upward price movements (U), downward price movements (D) and the true range of the prices (TR). These are often expressed in an equation as EMAUP, EMADOWN and EMATR.

The computations for the various EMAs are complex and numerous. Once they are found, however, they can be used to compute the directional movement, or DM, for whatever time interval is selected. The standard interval is 14 periods. The returned value of DM can be positive (+DM), negative (-DM) or zero.

Negative Directional Movement (-DM) is calculated as:

DM=EMADOWNEMATRwhere:EMADOWN = Exponential moving average of downwardprice movementsEMATR = Exponential moving average of the truerange of prices\begin{aligned} &-\text{DM} = \frac{EMADOWN}{EMATR} \\ &\textbf{where:}\\ &\text{EMADOWN = Exponential moving average of downward}\\ &\text{price movements}\\ &\text{EMATR = Exponential moving average of the true}\\ &\text{range of prices}\\ \end{aligned}DM=EMATREMADOWNwhere:EMADOWN = Exponential moving average of downwardprice movementsEMATR = Exponential moving average of the truerange of prices

Positive Directional Movement (+DM) is calculated as:

+DM=EMAUPEMATRwhere:EMAUP = Exponential moving average of upwardprice movementsEMATR = Exponential moving average of the truerange of prices\begin{aligned} &+\text{DM} = \frac{EMAUP}{EMATR} \\ &\textbf{where:}\\ &\text{EMAUP = Exponential moving average of upward}\\ &\text{price movements}\\ &\text{EMATR = Exponential moving average of the true}\\ &\text{range of prices}\\ \end{aligned}+DM=EMATREMAUPwhere:EMAUP = Exponential moving average of upwardprice movementsEMATR = Exponential moving average of the truerange of prices

Once those values generate returns, they help form the directional index (DX), which is calculated as:

DX=+DI  DI+DI + DIDX = \left|\frac{+\text{DI }-\text{ }-\text{DI}}{+\text{DI }+\text{ }-\text{DI}}\right|DX=+DI + DI+DI  DI

Once the DX value is found, average directional index (ADX) is calculated as:

ADX=EMADXn12n+1(DXnEMADXn1)where:EMADX = Exponential moving average ofdirectional indexDX=Directional indexn=Time interval\begin{aligned} &ADX = \frac{EMADX_{n-1}}{\frac{2}{n+1} (DX_n - EMADX_{n-1})}\\ &\textbf{where:}\\ &\text{EMADX = Exponential moving average of}\\ &\text{directional index}\\ &DX=\text{Directional index}\\ &n=\text{Time interval}\\ \end{aligned}ADX=n+12(DXnEMADXn1)EMADXn1where:EMADX = Exponential moving average ofdirectional indexDX=Directional indexn=Time interval

The chart reflects the values of +DI, -DI and ADX over the course of the time interval.