Cancelled Order Identification Problem
Cancelled Order Identification Problem
25 May 2024, 16:36
Hi,
When a PendingStopLimitOrder fails to be filled due to the price range being exceeded in backtest, I am only seeing cancelled orders rather than any other Unfilled/Failed event type.
Additionally, the PendingOrderCancelledEventArgs.Reason == “Cancelled” which is not very informative.
My bot is also cancelling Orders, and Comments and Labels are immutable, so I don't see anyway to distinguish between (Unfilled)PendingStopLimitOrders by the server
and PendingOrders cancelled by the bot, or indeed by the user.
Is there a workaround to achieve this level of granularity?
Cheers,
Clark
Replies
Clark22
27 May 2024, 10:49
RE: Cancelled Order Identification Problem
PanagiotisCharalampous said:
Hi Clark,
You can keep track of which orders you are cancelling yourself by keeping them in a collection on the client side. Then you can check if the cancelled order exists in your collection or not.
Best regards,
Panagiotis
Panagiotis
Thanks Panagiotis, yes I decided to use async and count bot cancellations in the callback, which helps. But I would still like to see events for server cancellations and manual cancellations. When a StopLimitOrder isn't filled because the price is outside of range then there's no event or log. It's just another cancellation.
@Clark22
PanagiotisCharalampous
26 May 2024, 07:22
Hi Clark,
You can keep track of which orders you are cancelling yourself by keeping them in a collection on the client side. Then you can check if the cancelled order exists in your collection or not.
Best regards,
Panagiotis
@PanagiotisCharalampous