Wiki

Description

Interactive Brokers

Interactive Brokers

What is Interactive Brokers?

Interactive Brokers (IB) is a brokerage that can be used with TWM in two ways:

  1. As a broker — to execute trades on stocks, futures, and other instruments
  2. As a data source — to receive market data, if you have active IB market data subscriptions


To use Interactive Brokers with TWM, you need an active Interactive Brokers account.

Requirements Before Connecting

Before you can connect TWM to Interactive Brokers, you must:

  1. Have an Interactive Brokers account — Sign up at interactivebrokers.com if you don't have one.
  2. Install and run one of the following applications:
  3. TWS (Trader Workstation) — the full IB trading terminal
  4. IB Gateway — a lightweight alternative to TWS


Why do I need TWS or IB Gateway running?

TWM connects to Interactive Brokers through the IB API (not through REST or WebSocket). This means TWS or IB Gateway must be running locally on your computer for TWM to communicate with Interactive Brokers.

TWS (Trader Workstation)

TWS is Interactive Brokers' full-featured trading terminal.

How to download and install TWS:

1. Go to the Interactive Brokers download page: https://www.interactivebrokers.com/en/trading/download-tws.php

Image

2. Download the Latest version for your operating system.

3. Install TWS following the standard installation process.

4. Launch TWS.

Image

5. Log in with your Interactive Brokers credentials. Note: Interactive Brokers may require two-factor authentication (2FA). You will need to confirm the login via the IBKR Mobile app or your configured authenticator.

Image

6. Make sure the API settings in TWS are configured to allow connections. Go to Settings > Global Configuration > API > Settings and ensure:

  1. "Enable ActiveX and Socket Clients" is checked
  2. The Socket port is noted (default is usually 7496 for live)
Image


Image


IB Gateway

IB Gateway is a lighter alternative to TWS. It provides the same API connectivity but without the full trading terminal interface. Use IB Gateway if you don't need the TWS interface and prefer a minimal application running in the background.

How to download and install IB Gateway:

1. Go to the Interactive Brokers download page and find the IB Gateway section: interactivebrokers.com/en/trading/ibgateway-latest.php

Image

2. Download and install IB Gateway.

3. Launch IB Gateway and log in with your Interactive Brokers credentials.

Image

4. Once logged in, IB Gateway will show a minimal interface confirming the connection is active.

Image

5. Make sure the API settings in IB Gateway are configured to allow connections. Go to Configure > Settings > API > Settings and ensure:

  1. "Read-Only API" is unchecked
  2. The Socket port is noted (default is usually 7496 for live)
ImageImage


Either TWS or IB Gateway will work with TWM — choose whichever you prefer.

Connecting Interactive Brokers in TWM

To set up an Interactive Brokers connection in TWM:

  1. Open TWM and go to the Connections panel.
  2. Click Add Connection and select Interactive Brokers.
  3. Fill in the connection fields:
  4. Login — your Interactive Brokers username
  5. Password — your Interactive Brokers password
  6. Live Trading — enable this for live trading