I open an order as follows:

MainOrder=self.MarketOrder(symbol=symbol,quantity=order_size,tag='main', synchronous=False)

Note tag='main'.  Then:

def OnOrderEvent(self, orderEvent: OrderEvent) -> None:
        tag = orderEvent.Ticket.Tag
        self.Log(f"<{tag}>")

outputs this:

tag=<main - Oanda Fill Event>

tag should be “main” not “main - Oanda Fill Event”

How is this happening? Looking through the forum posts I saw a thread from 2020 saying the order functions don't support named parameters. But I have seen later posts that show examples with “tag=xxxxx”.

I am using tags to keep track of my main, stoploss, and take-profit orders. I understand QC does not support ‘bracket orders’ - orders with integrated SL & TP - so I have to manage them separately.

I am open to other ideas for how to manage this.