Connection and login

TWS localhost and Trusted IPs explained

Quick answer

Localhost means the computer running the app. Trusted IPs tell TWS which remote source addresses it may accept. A PickMyTrade desktop app on the same computer as TWS normally uses the local path, without exposing TWS to the internet.

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

Step by step

  1. 1 Confirm where TWS and the connecting desktop app actually run. A browser dashboard is not the same as the desktop client.
  2. 2 Open Global Configuration → API → Settings and scroll to the connection controls.
  3. 3 For a same-machine setup, keep the localhost-only restriction where supported.
  4. 4 For an intended remote setup, confirm the exact source address with your administrator before adding it to Trusted IPs. Use a private network or secure tunnel.
  5. 5 Reconnect and check the expected account and connection status.

A practical example

Suppose TWS and the desktop app are both on one VPS. From that app, localhost points to the same VPS, which is what you want. Now suppose the app is on your home laptop while TWS is on the VPS. Localhost points to the laptop instead. Before changing any trust rules, draw two boxes on paper and put each app in the box for the machine that runs it.

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

Screen reference

Lower TWS API Settings showing localhost-only and Trusted IPs controls
The localhost-only box is selected and the Trusted IPs list is empty in this paper session. These are observed settings, not instructions to allow a remote address. Captured in TWS paper mode on 3 October 2026. Open the image for full size.
How to confirm the result The intended client should connect; an other remote address should not gain access.

Mistake to avoid

Trusted IPs are individual addresses, not a reason to open your API port to every address. Do not copy a public IP from a forum.

Common questions

Is 127.0.0.1 my VPS?

Only from an app running on that same VPS. On your laptop it points back to your laptop.

Can I paste a subnet into Trusted IPs?

IBKR documents individual IP entries, not subnet notation.

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