Cancelled Order Identification Problem

Created at 25 May 2024, 16:36
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
CL

Clark22

Joined 17.05.2024

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


@Clark22
Replies

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

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