I implemented below code to find the OrderId of the each positions and lots. Does this OrderId match with broker's orderId ? 

 # Iterate over all securities in the portfolio
        for security in self.algorithm.Portfolio.Values:
            if security.Invested:
                symbol = security.Symbol.Value
                lots = []

                # Find all orders related to this security
                related_orders = [order for order in orders if order.Symbol.Value == symbol]

                for order in related_orders:
                    # Check if order's date is before or at the current holding's entry date
                    if order.Status == OrderStatus.Filled:
                        lots.append({
                            'Symbol': symbol,
                            'Quantity': order.Quantity,
                            'entryPrice': order.Price,
                            'entryDate': order.Time.date().isoformat(),
                            'OrderId': order.Id
                        })

                # Append lots to open positions
                open_positions.extend(lots)

For example, I have IB account after live deployment, when I initiate marketOrder, it returns the order_ticket which has orderId (order_ticket.OrderId). Is this the same OrderId as IB account has it ?

order_ticket = self.algorithm.MarketOrder(symbol, allowed_quantity)