code: def average_directional_index(close_data, high_data, low_data, period):
      
      avg_di = (abs(
                (positive_directional_index(
                  close_data, high_data, low_data, period) -
                negative_directional_index(
                  close_data, high_data, low_data, period)) /
                (positive_directional_index(
                  close_data, high_data, low_data, period) +
                 negative_directional_index(
                  close_data, high_data, low_data, period)))
                )
      adx = 100 * smma(avg_di, period)
      return adx
docs: Average Directional Index.
  
      Formula:
      ADX = 100 * SMMA(abs((+DI - -DI) / (+DI + -DI)))