Hi, would you please help with this code, ive tried different methods but cant seem to get the answer. I have attached my entire code. Please help. Thanks

from AlgorithmImports import *
class StockVolumeStrategy(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 1, 1)
        self.SetCash(100000)
        self.SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash)

        self.crypto_symbol_list = ['BTCUSD', 'ETHUSD', 'XRPUSD', 'LTCUSD']  
        self.lookback_period = 10  # 10-minute lookback period for volume
        self.volume_threshold = 5.0  # Volume threshold (5 times 10-minute average)
        self.bid_ask_ratio_threshold = 3.0  # Bid volume / Ask volume threshold
        self.min_daily_volume = 1000000  # Minimum volume on the day (1 million shares)
        self.target_profit_percentage = 0.05  # Target profit of 5%
        self.target_loss_percentage = 0.02  # Target loss of 2%

        self.open_positions = {}

        for symbol in self.crypto_symbol_list:
            self.AddCrypto(symbol, Resolution.Minute)

        self.Schedule.On(self.DateRules.EveryDay(), self.TimeRules.Every(TimeSpan.FromMinutes(10)), self.CheckAndTrade)

    def CheckAndTrade(self):
        if self.Portfolio.Cash < 100:
            return

        for symbol in self.crypto_symbol_list:
            if self.Securities[symbol].Exchange.DateTimeIsOpen(self.Time):
                trade_bar = self.History([symbol], self.lookback_period, Resolution.Minute).loc[symbol]
                if trade_bar is not None:
                    avg_volume = trade_bar['volume'].mean()
                    current_volume = trade_bar['volume'].iloc[-1]
                    
                    quote_bar = self.Securities[symbol].GetQuoteBar()
                    if quote_bar.BidSize > self.bid_ask_ratio_threshold * quote_bar.AskSize:
                        if current_volume > self.volume_threshold * avg_volume and self.daily_volume_check(symbol):
                            self.BuyCrypto(symbol)

    def BuyCrypto(self, symbol):
        if symbol not in self.open_positions:
            self.SetHoldings(symbol, 1.0)
            self.open_positions[symbol] = self.Securities[symbol].Price
            self.Debug(f"Buying {symbol} at {self.Securities[symbol].Price}")

    def daily_volume_check(self, symbol):
        volume_indicator = self.SMA(symbol, 10, Resolution.Daily)
        return volume_indicator.Current.Value > self.min_daily_volume

    def OnData(self, data):
        for symbol in self.crypto_symbol_list:
            if symbol in self.open_positions:
                current_price = data[symbol].Close
                entry_price = self.open_positions[symbol]
                target_profit_price = entry_price * (1 + self.target_profit_percentage)
                target_loss_price = entry_price * (1 - self.target_loss_percentage)

                if current_price >= target_profit_price or current_price <= target_loss_price:
                    self.Liquidate(symbol)
                    del self.open_positions[symbol]
                    self.Debug(f"Selling {symbol} at {current_price}")