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:$\begin{aligned} &-DM = \frac{EMADOWN}{EMATR} \\ &\textbf{where:}\\ &EMADOWN=\text{exponential moving average of downward price movements}\\ &EMATR=\text{exponential moving average of the true range of prices}\\ \end{aligned}$

Positive Directional Movement (+DM) is calculated as:

$\begin{aligned} &+DM = \frac{EMAUP}{EMATR} \\ &\textbf{where:}\\ &EMAUP=\text{exponential moving average of upward price movements}\\ &EMATR=\text{exponential moving average of the true range of prices}\\ \end{aligned}$

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

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

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

$\begin{aligned} &ADX = \frac{EMADX_{n-1}}{\frac{2}{n+1} (DX_n - EMADX_{n-1})}\\ &\textbf{where:}\\ &EMADX=\text{exponential moving average of directional index}\\ &DX=\text{directional index}\\ &n=\text{time interval}\\ \end{aligned}$

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