Hi

I am trying to get at tradebar object so that I can get high, low, close, open. I am using code from the Futures - Handling data documentation  but I does not work. I keep getting the :

Runtime Error: Trying to dynamically access a method that does not exist throws a TypeError exception. To prevent the exception, ensure each parameter type matches those required by the 'QuantConnect.Securities.Future.Future'>) method. Please checkout the API documentation.
  at on_data
    bar = data.bars.get(self._future)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 in main.py: line 19
My code is as follows:

class PensiveYellowGreenBaboon(QCAlgorithm):


    buyorder = None
    sellorder = None
    profit = None
    stoploss = None
    bar = None


    def initialize(self):
        self.set_start_date(2023, 1, 1)
        self.set_cash(100000)
        self._future = self.add_future(Futures.Indices.SP_500_E_MINI,
            resolution = Resolution.MINUTE)


    def on_data(self, data: slice) -> None:
        bar = data.bars.get(self._future)
        invested = self.check_for_existing_orders_or_positions()


        if not invested:
            if data.time.hour == 9 and data.time.minute == 31:
                buyorder = self.stop_market_order(self._future, 2, bar.high+0.25)
                sellorder = self.stop_market_order(self._future, 2, bar.Low-0.25)    
    

    def check_for_existing_orders_or_positions(self):
        if self.portfolio.invested:
            return True
        if self.transactions.get_open_orders_remaining_quantity() > 0:
            return True
       
        return False