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,
Which event happens 1st - PositionUpdate vs OrderExecuted/Updated
-
- Posts: 548
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 85 times
Re: Which event happens 1st - PositionUpdate vs OrderExecuted/Updated
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
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?
-
- Posts: 24
- Joined: Wed May 26, 2021 12:13 pm
- Has thanked: 2 times
Re: Which event happens 1st - PositionUpdate vs OrderExecuted/Updated
Hi Andrey,
This is an interesting topic. Do you recommend any approach to process these events if they are out-of-order?
This is an interesting topic. Do you recommend any approach to process these events if they are out-of-order?
-
- Posts: 548
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 85 times
Re: Which event happens 1st - PositionUpdate vs OrderExecuted/Updated
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.Do you recommend any approach to process these events if they are out-of-order