Skip to content

Trader Workstation (TWS) Configuration

OptionsRealTime connects to Interactive Brokers’ Trader Workstation (TWS) through the API. This requires enabling a few settings in TWS.

  1. In TWS Desktop, go to File > Global Configuration
  2. Navigate to API > Settings

Enable the following settings:

TWS API Settings

SettingValue
Enable ActiveX and Socket ClientsChecked
Read-Only APIChecked
Socket Port7496
Allow connections from localhost onlyChecked

Enable ActiveX and Socket Clients — Allows external applications to connect.

Read-Only API — Recommended for safety. OptionsRealTime only reads portfolio data and does not place or modify orders.

API Settings - Top

Socket Port — Use 7496 for TWS Desktop. If you are using IB Gateway, the default port is 4001.

API Settings - Port

Allow connections from localhost only — Restricts connections to your local machine.

API Settings - Localhost

Click OK to save your settings.

Continue to First Run