code: def __init__(self, frequency, instruments, bars, maxLen=None):
      super(OptimizerBarFeed, self).__init__(frequency, maxLen)
      for instrument in instruments:
          self.registerInstrument(instrument)
      self.__bars = bars
      self.__nextPos = 0
      self.__currDateTime = None
  
      try:
          self.__barsHaveAdjClose = (
              self.__bars[0][instruments[0]].getAdjClose() is not None
          )
      except Exception:
          self.__barsHaveAdjClose = False
  
imports: import abc
  from pyalgotrade import bar
  from pyalgotrade.dataseries import bards
  from pyalgotrade import feed
  from pyalgotrade import dispatchprio
label_desc: Use image node_id 1 to create a new OptimizerBarFeed object from inherited base classes: BaseBarFeed with example: obj = OptimizerBarFeed(frequency, instruments, bars, maxLen)