class MomentumScalperV3(QCAlgorithm):

def initialize(self):

ticker = "MSFT"

equity = self.add_equity(ticker, Resolution.SECOND, extended_market_hours=False, fill_forward=True)

                

                symbol = equity.symbol

                self.symbol_cache.append(symbol)

                symbol_properties = self.symbol_properties_database.get_symbol_properties(symbol.id.market, symbol, SecurityType.EQUITY, 'USD')

                security_exchange_hours = self.market_hours_database.get_exchange_hours(symbol.id.market, symbol, SecurityType.EQUITY)

                

                # Add PolygonLiveData (bars with VWAP)

                polygon_live = self.add_data(PolygonLiveData, ticker, properties=symbol_properties, exchange_hours=security_exchange_hours, resolution=Resolution.SECOND, fill_forward=True)

 

                polygon_live_symbol = polygon_live.symbol

                

                # Cache mapping between equity symbol and polygon symbol (both use same ticker)

                if not hasattr(self, 'polygon_symbol_cache'):

                    self.polygon_symbol_cache = {}

                self.polygon_symbol_cache[symbol] = polygon_live_symbol

 

 

def on_data(self, data: Slice):

if hasattr(algorithm, 'polygon_symbol_cache') and symbol in algorithm.polygon_symbol_cache:

 

 

 

 

 

 

 

dfadfdafda

 

try: