Indicators: Average Directional Movement Index (ADX)

 

Average Directional Movement Index (ADX):

Average Directional Movement Index technical indicator (ADX) helps to determine the market trend. It was developed and described in detail by Welles Wilder in his book "New concepts in technical trading systems".

The simplest trading method based on the system of directional movement implies comparison of two direction indicators: the 14-period +DI one and the 14-period -DI. To do this, one either puts the charts of indicators one on top of the other, or +DI is subtracted from -DI. W. Wilder recommends buying whenever the +DI crosses above the -DI, and selling when -DI crosses above the +DI.

Author: MetaQuotes Software Corp.

 
 //--- fill smoothed positive and negative buffers
      ExtPDIBuffer[i]=ExponentialMA(i,ExtADXPeriod,ExtPDIBuffer[i-1],ExtPDBuffer);
      ExtNDIBuffer[i]=ExponentialMA(i,ExtADXPeriod,ExtNDIBuffer[i-1],ExtNDBuffer);
      //--- fill ADXTmp buffer
      double dTmp=ExtPDIBuffer[i]+ExtNDIBuffer[i];
      if(dTmp!=0.0)
         dTmp=100.0*MathAbs((ExtPDIBuffer[i]-ExtNDIBuffer[i])/dTmp);
      else
         dTmp=0.0;
      ExtTmpBuffer[i]=dTmp;
      //--- fill smoothed ADX buffer
      ExtADXBuffer[i]=ExponentialMA(i,ExtADXPeriod,ExtADXBuffer[i-1],ExtTmpBuffer);

Calculation:

ADX = SUM ((+DI - (-DI)) / (+DI + (-DI)),N) / N

Where:

  • N - number of periods used for calculation;
  • SUM (..., N) - sum for N periods;
  • +DI - value ofPositive directional index;
  • -DI - value of Negative directional index.
 

I know that many auto trading sys are built with ADX,so it's a nice index.