IMHO a lot posted above is over complicated & over engineered.
The IB API is OK as a solution, and yes, of course is async.
How can communicating with an exchange not be?
- I send a new order -- and get an async ack.
- I send an amend -- and get an async ack.
- I get a *partial* fill.
- I get a fill.
- I send a cancel -- and get a cancel ack.
...
How would you make fills synchronous !?!
...
Also, having a static position structure can be useful. Update it on new / amend / fill / partial / cancal-ack.
Note that it should assume exposure, as-in assume "new" exposes you before ack, and that cancel always still exposes you *until* ack.
Also, the IB new-ack latency is pretty slow compared to "the competition" so I really would not bother with threading on the customer end. The slow part is from you to IB to Exch to IB to you .. and threading on your end does not help this much at all. Save 10ms then add their 300ms? Not worth the 10ms.
The IB API is OK as a solution, and yes, of course is async.
How can communicating with an exchange not be?
- I send a new order -- and get an async ack.
- I send an amend -- and get an async ack.
- I get a *partial* fill.
- I get a fill.
- I send a cancel -- and get a cancel ack.
...
How would you make fills synchronous !?!
...
Also, having a static position structure can be useful. Update it on new / amend / fill / partial / cancal-ack.
Note that it should assume exposure, as-in assume "new" exposes you before ack, and that cancel always still exposes you *until* ack.
Also, the IB new-ack latency is pretty slow compared to "the competition" so I really would not bother with threading on the customer end. The slow part is from you to IB to Exch to IB to you .. and threading on your end does not help this much at all. Save 10ms then add their 300ms? Not worth the 10ms.

