Connection and login

Connect a desktop app to TWS on a VPS

Quick answer

First decide whether the desktop app runs on the VPS with TWS or on a separate computer. Use localhost only for the same-machine case. A remote connection needs a planned network route and a verified source address.

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

Step by step

  1. 1 Write down which machine runs TWS and which runs the API client.
  2. 2 Read the TWS socket port under API → Settings.
  3. 3 For two apps on the VPS, configure the client for the local host and matching port.
  4. 4 For separate machines, use an administrator-approved private route and narrowly scoped access. Review localhost-only and Trusted IPs for that route.
  5. 5 Verify the account and reconnect behavior during a planned test window.

A practical example

Draw the route before you set it up: chart alert to PickMyTrade, then the desktop client to TWS. Put the desktop client and TWS on the machines where they really run. If both sit on the VPS, use their local link there. Do not paste the VPS socket port into TradingView’s webhook box. A web address for an alert and a local broker port do different jobs.

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 without opening the broker API to other machines.

Mistake to avoid

A TradingView webhook URL is not a TWS socket address. Never point a public webhook directly at your TWS port.

Common questions

What does localhost mean from my laptop?

Your laptop, not the remote VPS.

Do I put my IBKR password in the webhook?

No. Broker login and webhook routing are separate.

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