IB API and placing orders

Discussion in 'Order Execution' started by FT79, Aug 24, 2006.

  1. FT79


    I have a question about Interactive Brokers API and placing orders in US stocks.

    When I transmit orders threw API the orders are also triggered in Pre- and After hours trading. I want that the orders are only triggered during Regular Trading Hours.

    Has anybody an idea who I can solve this problem???

  2. The Order class (Java API) has ignoreRth, tif, goodAfterTime and goodUntilDate fields.
  3. You should probably try the IB Discussion Forum search function...
    For technical questions related to the API.
  4. There are two extended order attributes that pertain to orders executing outside regular trading hours.

    int rthOnly – This attribute pertains to all orders placed through the API when this is set to 0 then orders will trigger outside normal trading hours when set 1 then orders will only trigger within normal trading hours.

    boolean m_ignoreRth – This attribute corresponds to the TWS trigger method setting “Allow triggering outside of regular trading hours”. This attribute allows Stop orders on the Globex exchange to be trigger outside regular trading hours.

    In addition, I’d like to use this thread as a place where IB API users can make suggestions for new features and comment on the performance of current ones. We are in the process of creating an API support team that will provide a higher level of implementation and testing assistance. We would also like to start maintaining a wish list of programming changes we can add to our development queue.

    Please feel free to post any questions about our API services.
  5. I'd like to correct my previous post. New feature requests should be directed to the link below.


    Our site provides for a more structured review and voting process. This way the features you agree are most important will move into production faster.

    Questions on current functionality are welcome here.
  6. FT79


    Dear Mike,

    Thanks for helping me out! Is it also possible to program API so I don't have any shortposition in a US Stock (or a TWS setting), although my system wants to sell short? Because my system has only been backtested for going long in a US stock, not for short positions and in one occassion I had short position because of the extreem movements.

  7. Unfortunately there is not a setting in the TWS that can be configured to prohibit shorting in a margin account. That restriction would need to be enforced within the your API.
  8. FT79


    Thanks for your response