Helps measure the strength of a trend, whether its up or down.
The Plus Directional Indicator (+DI) and Minus Directional Indicator (-DI) are derived from smoothed averages of these differences and measure trend direction over time. These two indicators are often collectively referred to as the Directional Movement Indicator (DMI).
The Average Directional Index (ADX) is in turn derived from the smoothed averages of the difference between +DI and -DI; it measures the strength of the trend (regardless of direction) over time.
Directional movement is positive (plus) when the current high minus the prior high is greater than the prior low minus the current low. This so-called Plus Directional Movement (+DM) then equals the current high minus the prior high, provided it is positive. A negative value would simply be entered as zero.
Directional movement is negative (minus) when the prior low minus the current low is greater than the current high minus the prior high. This so-called Minus Directional Movement (-DM) equals the prior low minus the current low, provided it is positive. A negative value would simply be entered as zero.
Lets Denote:
Calculation:
$$ \text{TR} = \max(\text{High} - \text{Low}, |\text{High} - \text{Previous Close}|, |\text{Low} - \text{Previous Close}|) $$
$$ +DM = \begin{cases} \text{High}t - \text{High}{t-1} & \text{if } (\text{High}t - \text{High}{t-1}) > (\text{Low}_{t-1} - \text{Low}_t) \text{ and } (\text{High}t - \text{High}{t-1}) > 0 \\ 0 & \text{otherwise} \end{cases} $$
$$ -DM = \begin{cases} \text{Low}_{t-1} - \text{Low}t & \text{if } (\text{Low}{t-1} - \text{Low}t) > (\text{High}t - \text{High}{t-1}) \text{ and } (\text{Low}{t-1} - \text{Low}_t) > 0 \\ 0 & \text{otherwise} \end{cases} $$
$$ \text{Smoothed ATR} = \text{Smooth the TR values using a moving average} $$
$$ +DI = \left( \frac{\text{Smoothed +DM}}{\text{Smoothed ATR}} \right) \times 100 $$