code: def __init__(self, period):
      assert period > 1
      # We need N + 1 samples to calculate N averages because they are calculated based on the diff with previous values.
      super(RSIEventWindow, self).__init__(period + 1)
      self.__value = None
      self.__prevGain = None
      self.__prevLoss = None
      self.__period = period
  
file_path: pyalgotrade/pyalgotrade/technical/rsi.py
imports: from six.moves import xrange
  from pyalgotrade import technical
label_desc: Use image node_id 1 to create a new RSIEventWindow object from inherited base classes: technical with example: obj = RSIEventWindow(period)