code: def onBars(self, bars):
      # Wait for enough bars to be available to calculate SMA and RSI.
      if (
          self.__exitSMA[-1] is None
          or self.__entrySMA[-1] is None
          or self.__rsi[-1] is None
      ):
          return
  
      bar = bars[self.__instrument]
      if self.__longPos is not None:
          if self.exitLongSignal():
              self.__longPos.exitMarket()
      elif self.__shortPos is not None:
          if self.exitShortSignal():
              self.__shortPos.exitMarket()
      else:
          if self.enterLongSignal(bar):
              shares = int(
                  self.getBroker().getCash()
                  * 0.9
                  / bars[self.__instrument].getPrice()
              )
              self.__longPos = self.enterLong(
                  self.__instrument, shares, True
              )
          elif self.enterShortSignal(bar):
              shares = int(
                  self.getBroker().getCash()
                  * 0.9
                  / bars[self.__instrument].getPrice()
              )
              self.__shortPos = self.enterShort(
                  self.__instrument, shares, True
              )
  
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 8 for calling the RSI2 obj's underlying member method code with example usage: obj.onBars(bars) without return types