Skip to content

Order filled after IB cancellation - Multiple fills on single contract order #1580

@garcia42

Description

@garcia42

Summary

Experienced a critical issue where Interactive Brokers (IB) automatically cancelled 15 consecutive limit orders due to "Order TIF was set to DAY based on order preset" (Error 10349), but all 15 orders were actually filled despite showing as cancelled. This resulted in the system recording a fill quantity that exceeded the intended trade quantity.

Environment

  • Date: 2025-11-21 08:00:02-08:00:19 UTC
  • Instrument: V2X (VSTOXX futures) contract 20260200
  • Broker: Interactive Brokers (EUREX exchange)
  • Symbol: V2TX
  • Strategy: dynamic_rob_strategy
  • Order ID: 63 (instrument), 798-812 (broker orders)

Detailed Timeline

  • 08:00:02 - First order (798) submitted at limit price 21.6, immediately cancelled by IB
  • 08:00:03-08:00:19 - Orders 799-812 submitted and cancelled in rapid succession (approximately 1-2 seconds apart)
  • 08:00:19 - System records fill: Changed fill qty from [0] to [-1]
  • 08:00:19 - Position updated from 0 to -1
  • 08:00:19 - Error: Can't fill order with fill [-2] more than trade quantity [-1]

Logs

Orders canceled

2025-11-21 08:00:02 DEBUG stack_handler {'type': 'run_stack_handler', 'strategy_name': 'dynamic_rob_strategy', 'instrument_code': 'V2X', 'contract_order_id': 63, 'instrument_order_id': 63} Sending order (Order ID:63) Type best for dynamic_rob_strategy/V2X/20260200, qty [-1], fill [0]@ price, None Parent:63 Children:no_children to algo sysexecution.algos.algo_original_best.algoOriginalBest
2025-11-21 08:00:02 DEBUG stack_handler {'type': 'run_stack_handler', 'strategy_name': 'dynamic_rob_strategy', 'instrument_code': 'V2X', 'contract_order_id': 63, 'instrument_order_id': 63} Imbalance ratio for ticker analysisTick(order='S', side_price=21.55, mid_price=21.575000000000003, offside_price=21.6, spread=0.05000000000000071, side_qty=36.0, offside_qty=212.0, imbalance_ratio=5.888888888888889) 5.888889 exceeds threshold 5.000000
2025-11-21 08:00:02 DEBUG stack_handler {'type': 'run_stack_handler', 'strategy_name': 'dynamic_rob_strategy', 'instrument_code': 'V2X', 'contract_order_id': 63, 'instrument_order_id': 63} Created a broker order (Order ID:no order ID) Type limit for dynamic_rob_strategy/V2X/20260200, qty [-1], fill [0]@ price, None Parent:63 Children:no_children (not yet submitted or written to local DB)
2025-11-21 08:00:02 DEBUG stack_handler {'component': 'ibExecutionStackData', 'strategy_name': 'dynamic_rob_strategy', 'instrument_code': 'V2X', 'contract_order_id': 63, 'broker_order_id': ''} Going to submit order (Order ID:no order ID) Type limit for dynamic_rob_strategy/V2X/20260200, qty [-1], fill [0]@ price, None Parent:63 Children:no_children to IB
2025-11-21 08:00:02 DEBUG stack_handler {'component': 'ibExecutionStackData', 'strategy_name': 'dynamic_rob_strategy', 'instrument_code': 'V2X', 'contract_order_id': 63, 'broker_order_id': ''} Order submitted to IB
2025-11-21 08:00:02 DEBUG stack_handler {'type': 'run_stack_handler', 'strategy_name': 'dynamic_rob_strategy', 'instrument_code': 'V2X', 'contract_order_id': 63, 'broker_order_id': ''} Submitted order to IB (Order ID:no order ID) Type limit for dynamic_rob_strategy/V2X/20260200, qty [-1], fill [0]@ price, None Parent:63 Children:no_children
2025-11-21 08:00:02 DEBUG stack_handler {'type': 'run_stack_handler', 'strategy_name': 'dynamic_rob_strategy', 'instrument_code': 'V2X', 'contract_order_id': 63, 'broker_order_id': 798} Managing trade (Order ID:798) Type limit for dynamic_rob_strategy/V2X/20260200, qty [-1], fill [0]@ price, None Parent:63 Children:no_children with algo 'original-best'
2025-11-21 08:00:02 DEBUG stack_handler {'component': 'ibStaticData'} Reqid 146671: 10349 Order TIF was set to DAY based on order preset. for None
2025-11-21 08:00:02 DEBUG stack_handler {'component': 'ibExecutionStackData'} Reqid 146671: 10349 Order TIF was set to DAY based on order preset. for None
2025-11-21 08:00:02 DEBUG stack_handler {'type': 'run_stack_handler', 'strategy_name': 'dynamic_rob_strategy', 'instrument_code': 'V2X', 'contract_order_id': 63, 'broker_order_id': 798} Imbalance ratio for ticker analysisTick(order='S', side_price=21.55, mid_price=21.575000000000003, offside_price=21.6, spread=0.05000000000000071, side_qty=36.0, offside_qty=212.0, imbalance_ratio=5.888888888888889) 5.888889 exceeds threshold 5.000000
2025-11-21 08:00:02 WARNING stack_handler Order has been cancelled: not by algo
2025-11-21 08:00:03 WARNING stack_handler Order has been cancelled: not by algo
[... repeated for orders 798-812 ...]
2025-11-21 08:00:19 DEBUG stack_handler Changed fill qty from [0] to [-1]
2025-11-21 08:00:19 WARNING stack_handler Can't fill order with fill [-2] more than trade quantity [-1]

IB Error for each order

2025-11-21 08:00:12 WARNING ib_insync.wrapper Canceled order: Trade(contract=Contract(secType='FUT', conId=793356099, symbol='V2TX', lastTradeDateOrContractMonth='20260218', multiplier='100', exchange='EUREX', currency='EUR', localSymbol='FVS 20260218 M', tradingClass='FVS'), order=LimitOrder(orderId=146761, clientId=157, action='SELL', totalQuantity=1, lmtPrice=21.6, account='U16457654'), orderStatus=OrderStatus(orderId=146761, status='Cancelled', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2025, 11, 21, 13, 0, 12, 819646, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2025, 11, 21, 13, 0, 12, 830243, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 146761: Order TIF was set to DAY based on order preset.', errorCode=10349)], advancedError='')

Questions

Questions

  1. Why did IB cancel all orders with error 10349? Were the TIF (Time In Force) settings incorrect for EUREX market hours?
  2. How were cancelled orders filled? Is this a timing issue where fills arrived after cancellation messages?
  3. Does the existing pass_fills_from_broker_to_broker_stack mechanism handle this scenario? The documentation mentions this as a backup for catching late fills, but it may not handle multiple fills on cancelled orders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions