Page 1 of 1

Which event happens 1st - PositionUpdate vs OrderExecuted/Updated

Posted: Thu May 13, 2021 1:08 am
by blk
Hi,

Lets say we have an addon subscribed to orderListener and positionListener... Is there any guarantee on which event happens/arrives first to an API subscribed addon when you are filled?

Does the position update is sent first to the addon or the order executed/filled ? Or Bookmap just sends all events and the order of events is not guaranteed 

Thanks,

Re: Which event happens 1st - PositionUpdate vs OrderExecuted/Updated

Posted: Thu May 13, 2021 7:24 am
by Andry API support
order executed/filled is likely to come first but the order of events is not guaranteed. The order depends on a L0 adapter implementation which in its turn depends on an exchange's API.

Re: Which event happens 1st - PositionUpdate vs OrderExecuted/Updated

Posted: Thu May 13, 2021 12:32 pm
by blk
Got it, thanks for your reply. Is there a way we can expand the Rithmic or CQG L0 adapter to add new features such as server side volume stops?

 

Re: Which event happens 1st - PositionUpdate vs OrderExecuted/Updated

Posted: Wed May 26, 2021 12:15 pm
by fenepet965
Hi Andrey,

This is an interesting topic. Do you recommend any approach to process these events if they are out-of-order?

Re: Which event happens 1st - PositionUpdate vs OrderExecuted/Updated

Posted: Thu May 27, 2021 4:21 pm
by Andry API support
Do you recommend any approach to process these events if they are out-of-order
if your module mechanics strongly depends on the order of events a possible way would be calculating position in your module based on order updates (like adapters or Bookmap do when an exchange does not provide position info). In this case you may use position info from Bookmap only to make sure your calculation is correct in the long run. Your calculated position and position info from Bookmap may differ but only during a short interval (fraction of a second usually) - due to unpredicted events ordering.