- Solve real problems with our hands-on interface
- Progress from basic puts and calls to advanced strategies

Posted October 26, 2026 at 12:10 pm
The author of this article is not affiliated with Interactive Brokers.
Placing a first order through the TWS API can take an afternoon. Keeping the system running correctly every day, with nobody watching the screen, takes much more work. This article covers what decides whether an automated system gets through a normal week: the daily restart, reconnecting, pacing limits, duplicate orders and reconciliation. None of it depends on what the strategy does.
TWS and IB Gateway restart once a day by design. The automatic restart setting handles this when nobody is there. About once a week, after IBKR’s weekend server reset, they ask for a fresh login with two factor authentication. A system that expects the connection to stay up forever will fail on its first night.
Treat the restart as a normal event:
IB Gateway is usually the better choice for an unattended system. It is lighter than Trader Workstation, and it has no trading screen that someone can change by accident.
Connections also drop outside the restart window, for example after a network problem or a Gateway fault. The TWS API reports this with system messages. Message 1100 means the connection between IBKR and TWS is lost. Messages 1101 and 1102 mean it is back, with market data lost (1101) or kept (1102). Your system should react to each one on purpose:
Confirming state is the most important step. After any reconnect, ask IBKR for your open orders, positions and recent executions, and rebuild your picture from what IBKR reports. What your system remembers about the last minute is only a guess. IBKR’s records are the facts.
The TWS API limits how many requests a client can send each second. Since early 2025 the limit follows your account’s market data lines. It is half the number of lines, so the default of 100 lines allows 50 requests a second. If the pacing warning is switched on in TWS, going over the limit returns error 100, and repeated breaches end the API session. If it is switched off, TWS slows your requests down by itself. The connection stays up, but orders are quietly delayed.
Historical data requests have their own, stricter limits.
Pacing problems rarely come from the strategy. They usually come from a burst of requests at startup, from asking again and again instead of streaming, and from retry loops that fire as fast as they can. Three habits prevent most of them:
A duplicated order is the most expensive bug in automated trading. It can happen when a signal is handled twice after a reconnect, or when a request is retried after a timeout that had actually worked. Guard against it in three places:
Positions can drift from what your system expects for ordinary reasons: a partial fill, a manual trade in the same account, a corporate action, or an order cancelled by IBKR. Compare your positions and open orders with IBKR’s on a schedule, and decide beforehand what happens when they differ. Usually the right answer is to stop new orders in that instrument and alert a person, rather than fixing the difference automatically.
Every unattended system needs a kill switch that a person can reach quickly. It also needs limits that stop it without a person: a maximum position, a maximum number of orders in a period, and a daily loss limit set by the trader. When a limit is reached, the system should stop sending orders, cancel open orders if the trader’s rules say so, and tell someone.
IBKR’s paper trading account is the place to find these problems. Run the system there through several restarts, disconnects and partial fills before it goes near a live account. Paper fills are kinder than real ones, so a clean paper run is the minimum, not proof that live trading will behave the same.
Most of a reliable IBKR system is basic groundwork. Plan for the daily restart. Rebuild your state from IBKR after every reconnect. Stay under the pacing limit. Make duplicate orders impossible. Check positions all day. Keep a kill switch within reach. When these are done, the strategy is the only thing left to think about.
Already an Interactive Brokers Client?
New to Interactive Brokers?
Information posted on IBKR Campus that is provided by third-parties does NOT constitute a recommendation that you should contract for the services of that third party. Third-party participants who contribute to IBKR Campus are independent of Interactive Brokers and Interactive Brokers does not make any representations or warranties concerning the services offered, their past or future performance, or the accuracy of the information provided by the third party. Past performance is no guarantee of future results.
This material is from Trade Vectors LLP and is being posted with its permission. The views expressed in this material are solely those of the author and/or Trade Vectors LLP and Interactive Brokers is not endorsing or recommending any investment or trading discussed in the material. This material is not and should not be construed as an offer to buy or sell any security. It should not be construed as research or investment advice or a recommendation to buy, sell or hold any security or commodity. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.
Please keep in mind that the examples discussed in this material are purely for technical demonstration purposes, and do not constitute trading advice. Also, it is important to remember that placing trades in a paper account is recommended before any live trading.
The order types available through Interactive Brokers LLC's trading platforms are designed to help you limit your loss and/or lock in a profit. Market conditions and other factors may affect execution. In general, orders guarantee a fill or guarantee a price, but not both. In extreme market conditions, an order may either be executed at a different price than anticipated or may not be filled in the marketplace.
Join The Conversation
For specific platform feedback and suggestions, please submit it directly to our team using these instructions.
If you have an account-specific question or concern, please reach out to Client Services.
We encourage you to look through our FAQs before posting. Your question may already be covered!