I'm trying to use Quantbook to get equity data. The algorithm works well in backtests, but it's not working in live mode. It throws an exception during algorithm initialization. Has anyone had a similar problem with Quantbook before?

 

from AlgorithmImports import *

class QuantbookTestingAlgorithm(QCAlgorithm):

    def Initialize(self):

        self.SetTimeZone(TimeZones.London)

        self.AddUniverse(self.SelectSymbols)

        self.universe = {}

        self.qb = QuantBook()
        
    def OnData(self, data):
        pass
                 
    def OnSecuritiesChanged(self, changes):

        for s in changes.AddedSecurities:

            if str(s.Symbol) not in self.universe:

                self.universe[str(s.Symbol)] = s
                self.qb.AddEquity(str(s.Symbol).split(' ')[0])

        for s in changes.RemovedSecurities:
            
            if str(s.Symbol) in self.universe.keys():
                
                self.universe.pop(str(s.Symbol))
                self.qb.RemoveSecurity(str(s.Symbol).split(' ')[0])

    def SelectSymbols(self, symbols):
        selected = [c for c in symbols if c.HasFundamentalData]
        sorted_by_dollar_volume = sorted(selected, key=lambda c: c.DollarVolume, reverse=True)
        return [ c.Symbol for c in sorted_by_dollar_volume[:50] ]