Replies: 1 comment 2 replies
-
Yeah, sometimes orders get filled before updates can be processed due to how IBKR systems and the market works. The primary problem is orders can fill in milliseconds (or faster) while our requests to update IBKR with new settings (price/size modifications, cancel requests) can take anywhere from 1 to 10 seconds. If we have a live order, then we submit a cancel at time N, but IBKR takes 3 seconds to move our cancel request to the market, the request can still fill at any time between N and N+3 seconds. The market never saw the cancel request and it's out of our hands. I've even seen some orders go directly from PreSubmitted -> Filled with nothing else in the middle during busy times, but at other volatile times, I've seen order placement or modification take 10 seconds to move from PreSubmitted (reaching IBKR) to Submitted (reaching an exchange) — in the "between time" from submitting a new request and the request reaching the market, the old size/price/orders are still in full effect and there's nothing we can do about it (and IBKR doesn't have any guarantee for API to market update latency; it can take milliseconds or 10+ seconds for API requests to reach the market). The only safe solutions I've found:
|
Beta Was this translation helpful? Give feedback.
-
I have changed nothing in my code, suddenly today the cancelOrder stopped working and I lost some money. My client failed to cancel two different orders:
Here's the log from the Trade for one of them:
My client issued the first cancel a second after submitting the order. Then issued a second cancel 6 seconds after that. The order went to PreSubmitted state 8 seconds after the second cancel and filled after that.
log=[13:49:43, PendingSubmit; 13:49:44, PendingCancel; 13:49:50, PendingCancel; 13:49:58, PreSubmitted; 13:49:58, PreSubmitted, Fill [email protected]; 13:49:58, Filled]
Has anyone else noticed this? Nothing should have changed on my side, and the cancelling was working fine yesterday.
Beta Was this translation helpful? Give feedback.
All reactions