code: def onBars(self, bars):
      bar = bars[self.__instrument]
      self.info(
          "Price: %s. Volume: %s." % (bar.getClose(), bar.getVolume())
      )
  
      # Wait until we get the current bid/ask prices.
      if self.__ask is None:
          return
  
      # If a position was not opened, check if we should enter a long position.
      if self.__position is None:
          if cross.cross_above(self.__prices, self.__sma) > 0:
              self.info("Entry signal. Buy at %s" % (self.__ask))
              self.__position = self.enterLongLimit(
                  self.__instrument, self.__ask, self.__posSize, True
              )
      # Check if we have to close the position.
      elif (
          not self.__position.exitActive()
          and cross.cross_below(self.__prices, self.__sma) > 0
      ):
          self.info("Exit signal. Sell at %s" % (self.__bid))
          self.__position.exitLimit(self.__bid)
  
file_path: pyalgotrade/samples/tutorial_bitstamp_1.py
imports: from pyalgotrade.bitstamp import barfeed
  from pyalgotrade.bitstamp import broker
  from pyalgotrade import strategy
  from pyalgotrade.technical import ma
  from pyalgotrade.technical import cross
label_desc: Use image node_id 7 for calling the Strategy obj's underlying member method code with example usage: obj.onBars(bars) without return types