Skip to main content

Interactive Brokers

MesoLive fully supports integration with Interactive Brokers using Trader Workstation (TWS) for order routing and market data. To connect your Interactive Brokers account to MesoLive, you need to have:

  • Real-time market data subscription
  • Running copy of Trader Workstation (TWS)
  • MesoLive-Agent installed to connect to TWS

Trader Workstation Setup

MesoLive Agent communicates with TWS using the API interface.

The following steps describe how to enable API access in TWS.

TWS Configuration:

  1. Open Trader Workstation (TWS)
  2. Go to File > Global Configuration > API > Settings
  3. Check the box for Enable ActiveX and Socket Clients
  4. Make sure 'Read-Only API' is unchecked
  5. Make a note of your 'Socket Port' (default is 7496 for live accounts and 7497 for paper trading)

The resulting configuration should look similar to this:

TWS API Settings

MesoLive Agent Setup:

Click Configure in MesoLive-Agent to enable TWS and to specify connection details. Check 'Enabled' under 'IBKR - Trader Workstation' to activate the connection. Specify:

  • Host: the host TWS is running on. It is localhost if you are running it on the same machine.
  • Port: the Socket Port specified in TWS API Configuration.
  • ClientID: an identifier for the connection which must be unique for each TWS API connection.
TWS API Settings

Validation

Once the configuration is complete, the TWS Connection will turn green in the Main View of MesoLive-Agent.

TWS API Settings