Understanding all 13 OrderStatus states in TWS-Link

Discuss, post your questions about TWSLink here.

Users who just registered, please write an email to
forum@trade-commander.de
with your username mentioned.
So we can distinguish you from bots.
Thank you
Post Reply
Rocket130713
Posts: 21
Joined: Sat Mar 03, 2018 9:23 am

Understanding all 13 OrderStatus states in TWS-Link

Post by Rocket130713 »

Hello,

If we place an order at the same time as the price moves outside of the CME's "price bands" (and therefore the market gets paused for 10 seconds) this example would mean our order gets "Rejected" by the CME exchange.

--> What value (id) does OrderStatus return when the order is Rejected?

--> Does OrderStatus return "Cancelled" (id=10) when order is actually "Rejected" by the Futures exchange?

--> When does OrderStatus return a state called "invalid"?

--> When does OrderStatus return a state called "inactive"?

--> What is an "invalid" and "inactive" OrderStatus? Would you please be able to give some simple examples?

--> What does "cancel transmitted" mean, when would this happen?

Just trying to get the "order handling" done safely from within our TradeStation EasyLanguage strategy code.

Many thanks in advance.

Kind regards,

Rod

board_admin
Site Admin
Posts: 244
Joined: Mon Apr 24, 2017 3:24 pm

Re: Understanding all 13 OrderStatus states in TWS-Link

Post by board_admin »

Outside price band.., i don't know. Please just try to catch this situation and follow up the logs. Most likely cancelled. Depends on IB.
  • 0 undefined
    TWSLink generic. Used for unknown states (e.g. new states introduced by IB. Unlikely)
  • 1 initial
    TWSLink generic. Order state upon creation. Remains initial until order placed with transmit >= 0
  • 2 transmitted
    TWSLink generic. Order state when an order been placed with transmit=1 but so far no order state reflected by IB. Highly volatile.
  • 3 cancel transmitted
    TWSLink generic. Order state when a cancellation initiated but so far no order state reflected by IB. Highly volatile.
  • 4 inactive
    IB native. This order state indicates order is created at TWS/Gateway but not sent to IB. Such orders have a blue/red transmit button at TWS:
  • 5 pending submit
    IB native. Order placed, no errors, is waiting for submitted state.
  • 6 pending cancel
    IB native. Order cancellation initiated, no errors, is waiting for cancelled state.
  • 7 presubmitted
    IB native. Typical for STP, STP LMT orders when stop price not yet triggered. Once triggered, state turns into submitted
  • 8 submitted
    IB native. Order submitted. So works at destination
  • 9 filled
    IB native. Order filled.
  • 10 cancelled
    IB native. Order cancelled.
  • 11 filled partially
    IB native. Order filled partially.
  • 12 invalid
    TWSLink genereric. This state is set, when IB rejected an order without the possibility to modify and replace it.

Post Reply