class_docstr: Defined by J. Welles Wilder, Jr. in 1978 in his book *"New Concepts in
  Technical Trading Systems"*.
  
  Intended to measure trend strength
  
  This indicator shows +DI, -DI:
    - Use PlusDirectionalIndicator (PlusDI) to get +DI
    - Use MinusDirectionalIndicator (MinusDI) to get -DI
    - Use AverageDirectionalIndex (ADX) to get ADX
    - Use AverageDirectionalIndexRating (ADXR) to get ADX, ADXR
    - Use DirectionalMovementIndex (DMI) to get ADX, +DI, -DI
    - Use DirectionalMovement (DM) to get ADX, ADXR, +DI, -DI
  
  Formula:
    - upmove = high - high(-1)
    - downmove = low(-1) - low
    - +dm = upmove if upmove > downmove and upmove > 0 else 0
    - -dm = downmove if downmove > upmove and downmove > 0 else 0
    - +di = 100 * MovingAverage(+dm, period) / atr(period)
    - -di = 100 * MovingAverage(-dm, period) / atr(period)
  
  The moving average used is the one originally defined by Wilder,
  the SmoothedMovingAverage
  
  See:
    - https://en.wikipedia.org/wiki/Average_directional_movement_index
class_docstr_tok: ["Defined","by","J.","Welles","Wilder",",","Jr.","in","1978","in","his","book","*","''","New","Concepts","in","Technical","Trading","Systems","''","*",".","Intended","to","measure","trend","strength","This","indicator","shows","+DI",",","-DI",":","-","Use","PlusDirectionalIndicator","(","PlusDI",")","to","get","+DI","-","Use","MinusDirectionalIndicator","(","MinusDI",")","to","get","-DI","-","Use","AverageDirectionalIndex","(","ADX",")","to","get","ADX","-","Use","AverageDirectionalIndexRating","(","ADXR",")","to","get","ADX",",","ADXR","-","Use","DirectionalMovementIndex","(","DMI",")","to","get","ADX",",","+DI",",","-DI","-","Use","DirectionalMovement","(","DM",")","to","get","ADX",",","ADXR",",","+DI",",","-DI","Formula",":","-","upmove","=","high","-","high","(","-1",")","-","downmove","=","low","(","-1",")","-","low","-","+dm","=","upmove","if","upmove",">","downmove","and","upmove",">","0","else","0","-","-dm","=","downmove","if","downmove",">","upmove","and","downmove",">","0","else","0","-","+di","=","100","*","MovingAverage","(","+dm",",","period",")","\/","atr","(","period",")","-","-di","=","100","*","MovingAverage","(","-dm",",","period",")","\/","atr","(","period",")","The","moving","average","used","is","the","one","originally","defined","by","Wilder",",","the","SmoothedMovingAverage","See",":","-","https",":","\/\/en.wikipedia.org\/wiki\/Average_directional_movement_index"]
code: def __init__(self):
      super(DirectionalIndicator, self).__init__()
  
      self.lines.plusDI = self.DIplus
      self.lines.minusDI = self.DIminus
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from .None import Indicator, And, If, MovAv, ATR
label_desc: Use image node_id 1 to create a new DirectionalIndicator object from inherited base classes: _DirectionalIndicator with example: obj = DirectionalIndicator()