I cannot think of any reason why TWS/IBGW would disconnect your client in the scenario you have described. Is there a chance that your client calls disconnect() under certain circumstances and that logic gets triggered inadvertently on larger orders?
?
Larger orders have a higher chance that they get incrementally filled by several smaller trades (instead of one trade of the requested quantity). Is your client prepared to receive multiple openOrder(), orderStatus(), execDetails(), and commissionReport() callbacks for the various trades caused by a single order?
?
´³¨¹°ù²µ±ð²Ô
?
On Mon, May 26, 2025 at 11:23 AM, <albert@...> wrote:
toggle quoted message
Show quoted text
I am using TWS under python and when I place orders on us_equities like AAPL or so and they have more than e.g. 200 shares, the following happens:
- sometimes I get filled right away, and in the next order status update i see filled = 200.?
In cases where i don't get filled right away, I get a disconnect from the gateway instead. After reconnect, all fills are completed. This behaviour is for MKT and LMT orders, sell and buy.?
I suspect some sort of algorith on IBKR server side that distributes the order somehow and causes internal error.?
When I place e.g. 5 orders, each 100 shares, then all is fine, no disconnect
here is a cut-out of a typical order
?
"headers":[('method', 'placeOrder')],
? ? ? ? ? "value":{
? ? ? ? ? ? ? 'contract': {
? ? ? ? ? ? ? ? ? 'symbol': 'AAPL',
? ? ? ? ? ? ? ? ? 'secType': 'STK',
? ? ? ? ? ? ? ? ? 'exchange': 'SMART',
? ? ? ? ? ? ? ? ? 'currency': 'USD'
? ? ? ? ? ? ? },
? ? ? ? ? ? ? 'order': {
? ? ? ? ? ? ? ? 'action': 'BUY',
? ? ? ? ? ? ? ? 'totalQuantity': 500,
? ? ? ? ? ? ? ? 'orderType': 'MKT',
? ? ? ? ? ? ? ? 'tif': 'DAY',?
? ? ? ? ? ? ? ? 'outsideRth': False
? ? ? ? ? ? ? }
? ? ? ? ? },
?