Not possible to get a list of filled orders


#1

Hello!

The following code produces a list of all orders in the execution list:

_TRACE( ibc.GetPendingList( 1, "" ));

This works fine and the type of result I get is "UPRO-SMART-STK,UPRO-SMART-STK,UPRO-SMART-STK,..."

However, if I want to get the list of filled orders, I get no results at all:

_TRACE( ibc.GetPendingList( 1, "Filled" ));

Same for Pending, Error, Cancelled lists...

Does this no longet work? (The code snippit is activated with a GUI button)


#2

_TRACE( ibc.GetPendingList( 1, "Submitted" )) works instead of "Pending".


#3

You should click on the IBController window in the Windows Task bar and look at the window content. It has UI that shows current orders with their statuses. All lists available are displayed there as tabs. Filled orders are in the "Executions" lists and available from GetExecList. As for statuses, you can easily see when they change.
If you do this, you will see that "Pending" does not really appear in that list. And is not really the same as "Submitted". Actually there is not a single "Pending" status but many different statuses of that kind. Please consult TWS API documentation for statuses that TWS API sends: https://interactivebrokers.github.io/tws-api/order_submission.html

Quote:

  • ApiPending - indicates order has not yet been sent to IB server, for instance if there is a delay in receiving the security definition. Uncommonly received.
  • PendingSubmit - indicates the order was sent from TWS, but confirmation has not been received that it has been received by the destination. Most commonly because exchange is closed.
  • PendingCancel - indicates that a request has been sent to cancel an order but confirmation has not been received of its cancellation.
  • PreSubmitted - indicates that a simulated order type has been accepted by the IB system and that this order has yet to be elected. The order is held in the IB system until the election criteria are met. At that time the order is transmitted to the order destination as specified.
  • Submitted - indicates that your order has been accepted at the order destination and is working.
  • ApiCancelled - after an order has been submitted and before it has been acknowledged, an API client client can request its cancellation, producing this state.
  • Cancelled - indicates that the balance of your order has been confirmed cancelled by the IB system. This could occur unexpectedly when IB or the destination has rejected your order.
  • Filled - indicates that the order has been completely filled.
  • Inactive - indicates an order is not working, possible reasons include:
    a) it is invalid or triggered an error. A corresponding error code is expected to the error() function.
    b) the order is to short shares but the order is being held while shares are being located.
    c) an order is placed manually in TWS while the exchange is closed.
    an order is blocked by TWS due to a precautionary setting and appears there in an untransmitted state