Hi All-

I have an algo using TradeBars but I would like to log Bid/Ask prices in OnData as a way to inform entry/exit decisions. So the bid/ask data would be logged at the same time and resolution as the incoming TradeBar data. I'm guessing this will require adding QuoteBars but I'm unsure of how to implement this. 

Below is the core code that handles data. I deleted out the strategy and universe filters.

    def Initialize(self):
        self.SetStartDate(2022, 8, 1)
        self.AddUniverse(self.CoarseSelectionFilter, self.FineSelectionFilter)
        self.UniverseSettings.Resolution = Resolution.Second
       
    def OnData (self, data):
        for symbol in self.Targets.keys():
            symbolData = self.Data[symbol]

            if not symbolData.IsReady: 
               continue


            price = self.Securities[symbol].Price
        
    def OnSecuritiesChanged(self, changes):
        for security in changes.AddedSecurities:
            symbol = security.Symbol
            if symbol not in self.Data:
                self.Data[symbol] = SymbolData(self, symbol)
        
        for security in changes.RemovedSecurities:
            symbol = security.Symbol
            if symbol in self.Data:
                symbolData = self.Data.pop(symbol, None)
                self.SubscriptionManager.RemoveConsolidator(symbol, symbolData.consolidator)

class SymbolData:
    def __init__(self, algorithm, symbol):
        self.algorithm = algorithm
        self.symbol = symbol
        self.Bars = RollingWindow[TradeBar](7)
        self.consolidator = TradeBarConsolidator(timedelta(days=1))
        self.consolidator.DataConsolidated += self.OnDataConsolidated
        algorithm.SubscriptionManager.AddConsolidator(symbol, self.consolidator)
    
    def OnDataConsolidated(self, sender, bar):
        self.Bars.Add(bar)
    
    @property
    def IsReady(self):
        return self.Bars.IsReady