Average Directional Movement Index (ADX)
Category: trend
Calculates trend strength and direction using Directional Movement (+DI/-DI) and a smoothed Directional Index (DX). This specific implementation uses sliding window sums instead of Wilder's RMA smoothing.
Formula
\begin{cases} TR = \max(H-L, |H-C_{prev}|, |L-C_{prev}|) \\ +DM = \text{if } (H-H_{prev} > L_{prev}-L \text{ and } H-H_{prev} > 0) \text{ then } H-H_{prev} \text{ else } 0 \\ -DM = \text{if } (L_{prev}-L > H-H_{prev} \text{ and } L_{prev}-L > 0) \text{ then } L_{prev}-L \text{ else } 0 \\ +DI = \min(100 \times \frac{\sum_{i=0}^{n-1} +DM_i}{\sum_{i=0}^{n-1} TR_i}, 50) \\ -DI = \min(100 \times \frac{\sum_{i=0}^{n-1} -DM_i}{\sum_{i=0}^{n-1} TR_i}, 50) \\ DX = 100 \times \frac{|+DI - -DI|}{+DI + -DI} \\ ADX = \frac{\sum_{i=0}^{n-1} DX_i}{n} \end{cases} \text{where } n = \text{period}
Inputs
- Period (default: 14)
See signal primitives and every published strategy that uses Average Directional Movement Index (ADX) on WOBR StrategyVerse.