ProtoOaOrderErrorEvent POSITION_NOT_FOUND | ORDER_NOT_FOUND

Created at 13 May 2024, 16:53
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!
raul_gherman's avatar

raul_gherman

Joined 01.03.2024

ProtoOaOrderErrorEvent POSITION_NOT_FOUND | ORDER_NOT_FOUND
13 May 2024, 16:53


Isn't the position_id field supposed to be populated if POSITION_NOT_FOUND error_code is returned by ProtoOaOrderErrorEvent?

Should this be covered by API (I think it is, right?), or it depends, it is something that broker can control?

(ProtoOaVersion 90)

 

ProtoOaOrderErrorEvent {
   payload_type: None,
   ctid_trader_account_id: 000redacted000,
   error_code: "POSITION_NOT_FOUND",
   order_id: Some(
       0,
   ),
   position_id: Some(
       0,
   ),
   description: Some(
       "Position not found with id 2416447",
   ),
}

 

if error_code is ORDER_NOT_FOUND, order_id field seems to be properly populated:

ProtoOaOrderErrorEvent {
   payload_type: None,
   ctid_trader_account_id: 000redacted000,
   error_code: "ORDER_NOT_FOUND",
   order_id: Some(
       4747037,
   ),
   position_id: None,
   description: Some(
       "Order not found with id 4747037",
   ),
}

Thank you!


@raul_gherman