I am getting duplicated orders Filled In during a backtest, my checks are not self.Transaction.GetOpenOrders(symbol) and not self.Portfolio[symbol].Invested, the orders are sent at the same time, how else can I check if that order has already been submitted?

for symbol in set(activeSymbols):

      if self.symbolDataBySymbol[symbol].indicator is not None and self.symbolDataBySymbol[symbol].indicator.buySignal:
                   if not self.Portfolio[symbol].Invested and not self.Transactions.GetOpenOrders(symbol):
                       entryTicket = self.LimitOrder(symbol, quantity, price)
                       entryTime = self.Time
                       self.symbolDataBySymbol[symbol].entryTicket = entryTicket
                       self.symbolDataBySymbol[symbol].entryTime = entryTime
                       
         

Author