The below code is what I come up with, but I get an error “Runtime Error: ArgumentException : Please subscribe to this symbol before adding a consolidator for it. Symbol: YM19H21”

from AlgorithmImports import *
#Futures.Indices.Dow30EMini NASDAQ100EMini SP500EMini
class BasicTemplateContinuousFutureAlgorithm(QCAlgorithm):
    def Initialize(self):
        self.SetStartDate(2021, 1, 1)
        self.SetEndDate(2021, 12, 31)
        self.ym = self.AddFuture(Futures.Indices.Dow30EMini, Resolution.Hour,
                                                  dataNormalizationMode = DataNormalizationMode.BackwardsRatio,
                                                  dataMappingMode = DataMappingMode.LastTradingDay,
                                                  contractDepthOffset= 0)
        self.nq = self.AddFuture(Futures.Indices.NASDAQ100EMini, Resolution.Hour, 
                                                  dataNormalizationMode = DataNormalizationMode.BackwardsRatio,
                                                  dataMappingMode = DataMappingMode.LastTradingDay,
                                                  contractDepthOffset= 0)

        self.consolidator_by_symbol = {}
    def OnData(self, data):
        currentSymbol = self.ym.Mapped
        self.Debug("test:  {} ".format(currentSymbol))
        if currentSymbol not in self.consolidator_by_symbol:
                CountConsolidator = QuoteBarConsolidator(timedelta(hours = 2))
                # CountConsolidator.DataConsolidated += self.BarHandler
                self.SubscriptionManager.AddConsolidator(currentSymbol, CountConsolidator)
                self.consolidator_by_symbol[currentSymbol] = CountConsolidator


    def OnOrderEvent(self, orderEvent):
        self.Debug("Purchased Stock: {0}".format(orderEvent.Symbol))

    def OnSecuritiesChanged(self, changes):
        self.Debug(f"{self.Time}-{changes}")
        
    def BarHandler(self, sender, bar):
            self.Log(f"Consolidated bar received at {self.Time}")

So What would be the correct way to do it?
Can anyone provide an example?
Thx in advance