Interactive Brokers returns multiple “presubmitted” order statuses for a single order

Discussion in 'App Development' started by Darth-trader, May 7, 2016.

  1. Has anyone experienced multiple order statuses per sent order? Is there a way to fix this or what is the best way to deal with it?

    Code:
    ./PosixSocketClientTest 10.1.55.2
    Start of POSIX Socket Client Test 0
    Attempt 1 of 50
    Connecting to 10.1.55.2:7496 clientId:0
    Connected to 10.1.55.2:7496 clientId:0
    Placing Order 42: BUY 1000 IBM at 0.010000
    Order: id=42, status=PreSubmitted
    Requesting Current Time
    The current date/time is: Sat May 7 12:20:04 2016
    Order: id=42, status=PreSubmitted
    Order: id=42, status=Cancelled
     
  2. I've seen this too. In my trading app the submitted and presubmitted messages are only used to update the GUI. Because of this the order will appear on the screen on the first message and be updated a few times with the repeats. It's obnoxious from a code perspective but is invisible on the GUI and doesn't affect the trading logic.

    If you really want to filter it just keep the orders in a map with order id as the key. If the order is already there then just ignore the repeated presubmitted messages. Of course if the order is being modified you don't want to ignore them but update the map entry.
     
    Darth-trader likes this.