code: def __init__(
      self,
      feed,
      instrument,
      entrySMA,
      exitSMA,
      rsiPeriod,
      overBoughtThreshold,
      overSoldThreshold,
  ):
      super(RSI2, self).__init__(feed)
      self.__instrument = instrument
      # We'll use adjusted close values, if available, instead of regular close values.
      if feed.barsHaveAdjClose():
          self.setUseAdjustedValues(True)
      self.__priceDS = feed[instrument].getPriceDataSeries()
      self.__entrySMA = ma.SMA(self.__priceDS, entrySMA)
      self.__exitSMA = ma.SMA(self.__priceDS, exitSMA)
      self.__rsi = rsi.RSI(self.__priceDS, rsiPeriod)
      self.__overBoughtThreshold = overBoughtThreshold
      self.__overSoldThreshold = overSoldThreshold
      self.__longPos = None
      self.__shortPos = None
  
file_path: pyalgotrade/samples/rsi2.py
imports: from pyalgotrade import strategy
  from pyalgotrade.technical import ma
  from pyalgotrade.technical import rsi
  from pyalgotrade.technical import cross
label_desc: Use image node_id 1 to create a new RSI2 object from inherited base classes: strategy with example: obj = RSI2(feed, instrument, entrySMA, exitSMA, rsiPeriod, overBoughtThreshold, overSoldThreshold)