Connection and login

TWS error 326: client ID already in use

Quick answer

Error 326 means another active API connection is using the same client ID. Find the duplicate app or assign a distinct supported ID. A client ID shows an API connection; it is not your IBKR account number.

Educational software guidance. Trading involves risk. Read the financial and information disclaimers.

Step by step

  1. 1 Open Help → Data Connections and check the API Connections list for client IDs. Check whether the same desktop app is open twice, including on a VPS.
  2. 2 Close only the duplicate instance after checking what it is managing. Keep the intended connection running.
  3. 3 If two different apps must connect, check each app’s supported client-ID setup.
  4. 4 Assign distinct IDs using the apps’ documented controls, or ask support if an app fixes its ID internally.
  5. 5 Reconnect once and review open orders and positions before resuming automation.

A practical example

Suppose you start a second copy of the same app by mistake. Both copies ask TWS to use client ID 7. TWS cannot treat them as two distinct clients with the same ID. Close the extra copy after checking that it is not the one managing your orders. If you really need two apps, use the IDs their setup guides call for. Keep the account number separate from these client IDs.

Illustrative scenario, not a record of a trade placed during this review.

Screen reference

TWS Market Data Connections with farm purpose and status, plus API client columns
The observed services are connected and the API client list is empty. Use this panel to read current status; it does not reproduce a disconnect or prove an app handshake completed. Captured in TWS paper mode on 3 October 2026. Open the image for full size.
TWS API Settings showing socket clients, read-only access, port and logging
Find the named control in API → Settings. The displayed values belong to a paper session and are examples, not universal recommendations. Captured in TWS paper mode on 3 October 2026. Open the image for full size.
How to confirm the result The second connection should stop returning 326. Existing orders should remain accounted for in the intended app.

Mistake to avoid

Changing an ID can change which orders an app can manage. Do not randomly change IDs while relying on it to manage existing exits.

Common questions

Is Master API client ID the same setting?

It has a separate role in receiving other clients’ updates. It is not a generic fix for duplicate connections.

Will reinstalling TWS help?

Start with the active connections. Reinstalling does not resolve two clients choosing the same ID.

Financial and information disclaimers

Financial disclaimer

These guides explain software. They are for education, not financial, investment, tax, or legal advice. No example is a suggestion to buy or sell a product or use a trading strategy. Trading can lose money, including all funds you put at risk. With margin, futures, short sales, or some options, losses can exceed your starting funds. Automation can fail, send duplicate orders, or act late. Stops do not guarantee a fill or a price. Review your orders and positions, and seek advice from a qualified professional for your own needs. Paper trades, examples, and past results do not predict live results or promise a profit.

Information disclaimer

This is general help based on the sources and check date shown on the page. Screens, settings, fees, data access, and product support can change or differ by app version, account, country, and broker. The content may contain errors or become out of date; accuracy, completeness, and continuous service are not guaranteed. Check current broker and app instructions before acting. Screenshots show where controls are; they do not prove that an order test passed. This guide does not replace broker terms or risk notices. References to IBKR and TradingView identify their products and do not imply their endorsement of this guide.

IBKR risk disclosures · IBKR paper-trading limits · SEC guidance on automated investment tools

PickMyTrade help · Independent guidance for Trader Workstation and the desktop integration. TWS images show paper trading. Other applications are named in the image captions. Settings and availability can vary by version and account.

Automate TradingView alerts to Interactive Brokers

See the IBKR integration