Hi!

I am trying to incorporate a history call whenever my futures contract rolls over, then update my consolidator and indicator to save the algorithm from having to wait until the indicator is ready again. I am using 512 tick trade bars and am struggling with the history call. I have attached my code below, is this a problem with the structure of tick dataframe in the history call? I'd really appreciate any examples or nudges in the right direction.

class MyStrugglesContinuous(QCAlgorithm):
    def Initialize(self):
        self.SetStartDate(2021, 1, 1)    #Set Start Date
        self.SetEndDate(2021, 4, 1)      #Set End Date
        self.SetCash(15000)
        self.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage)
        self.Settings.FreePortfolioValuePercentage = 0.3
        self._continuousContract = self.AddFuture(Futures.Metals.Copper, Resolution.Tick, 
                                                  dataNormalizationMode = DataNormalizationMode.Raw,
                                                  dataMappingMode = DataMappingMode.OpenInterest,
                                                  extendedMarketHours = True,
                                                  contractDepthOffset= 0)
        self.consolidators = dict()
        self._macd = MovingAverageConvergenceDivergence(12, 26, 9, MovingAverageType.Exponential)
        self._currentContract = None

    def OnData(self, data):
        for changedEvent in data.SymbolChangedEvents.Values:
            if changedEvent.Symbol == self._continuousContract.Symbol:
                self.Log(f"SymbolChanged event: {changedEvent}")
                

    def OnSecuritiesChanged(self, changes):
        self.Liquidate()
        self._currentContract = self.Securities[self._continuousContract.Mapped]                
        self.Debug(f"{self.Time}-{changes}")
        self.Log(f"{self.Time}-{changes}")

        for security in changes.AddedSecurities:
            consolidator = TickConsolidator(512)
            self.SubscriptionManager.AddConsolidator(security.Symbol, consolidator)
            self.RegisterIndicator(security.Symbol, self._macd, consolidator)
            self.consolidators[security.Symbol] = consolidator
            consolidator.DataConsolidated += self.OnDataConsolidated
			# make history call
            history = self.History(self._currentContract.Symbol, timedelta(days=10), Resolution.Tick)
            for index, row in history.iterrows():
                bar = TradeBar(index[1], self._currentContract.Symbol, row.open, row.high, row.low, row.close, row.volume)
            # Allow the consolidators to update
            consolidator.Update(data[self._currentContract.Symbol])
            self._macd.Update(data[self._currentContract.Symbol].EndTime, data[self.symbol].Close)
            #self._macd.Update(bar)#.Index[1], bar.close)


        for security in changes.RemovedSecurities:
            consolidator = self.consolidators.pop(security.Symbol)
            self.SubscriptionManager.RemoveConsolidator(security.Symbol, consolidator)
            consolidator.DataConsolidated -= self.OnDataConsolidated
        

        

Cheers!