Technical indicator Average Directionnal Index, usually known as ADX.
Calculation:
We first calculate +DM and -DM (the directional movement) , the number of points obtained in a direction. We apply a wilder moving average on +DM and -DM to calculate +DI and -DI. Then we calculate DX.
Dx = 100 x ((+DI) – (-DI)) / ((+DI) + (-DI)).
Finally to obtain ADX we apply again a wilder moving average on DX.
Syntax :
1 2 3 4 |
//N as Number of periods for calculation ADX[N] |