Skip to content

Commit 019c850

Browse files
committed
Move Error 10349 to Warning to not cancel order
IBKR emits an error code if your system is configured to use DAY orders but your order is NOT a DAY order. It doesn't cancel the order, it's just informational, so we must override the IBKR "error condition" because it's just a warning (i.e. we don't want this to ever delete an order from the client because it's still working in the market). Fixes #190
1 parent 973cd17 commit 019c850

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ib_async/wrapper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1618,13 +1618,14 @@ def error(
16181618
# 434 - The order size cannot be zero.
16191619
# 492 - ? not listed
16201620
# 10167 ? not listed
1621+
# 10349 - Warning about "Order TIF was set to DAY based on order preset" but does NOT cancel active order
16211622
# Note: error 321 means error validing, but if the message is the result of a MODIFY, the order _is still live_ and we must not delete it.
16221623
# TODO: investigate if error 321 happens on _new_ order placement with incorrect parameters too, then we should probably delete the order.
16231624

16241625
# Previously this was included as a Warning condition, but 202 is literally "Order Canceled" error status, so now it is an order-delete error:
16251626
# 202 - Order cancelled - Reason:
16261627

1627-
warningCodes = frozenset({105, 110, 165, 321, 329, 399, 404, 434, 492, 10167})
1628+
warningCodes = frozenset({105, 110, 165, 321, 329, 399, 404, 434, 492, 10167, 10349})
16281629
isWarning = errorCode in warningCodes or 2100 <= errorCode < 2200
16291630

16301631
if errorCode == 110 and isRequest:

0 commit comments

Comments
 (0)