Back to Blog
2 min read

IBKR TWS Configuration

Detailed guide to configure Interactive Brokers TWS for use with OptionTrigger

This guide covers the detailed configuration of Interactive Brokers Trader Workstation (TWS) for optimal use with OptionTrigger.

💡

Applies to: TWS and IB Gateway users

Prerequisites

  • Interactive Brokers account (live or paper)
  • TWS or IB Gateway installed
  • OptionTrigger Desktop installed

Step 1: Download TWS

Visit IBKR Website

Go to interactivebrokers.com and navigate to Trading → TWS.

Download Installer

Download the appropriate version for your operating system.

Download TWS

Step 2: Login to TWS

Launch TWS

Open TWS and enter your credentials.

TWS Login

Step 3: Enable API Access

Open Global Configuration

Click File → Global Configuration or the gear icon.

Select API → Settings in the left panel.

API Settings

Enable Socket Clients

Check Enable ActiveX and Socket Clients.

Set Socket Port

Set Socket port to 7496.

Set Port

⚠️

Important: OptionTrigger defaults to port 7496. IBKR TWS paper may default to 7497, so change TWS to 7496 for this guide or ensure your backend configuration matches the actual TWS/Gateway port.

SettingValueDescription
Socket port7496API connection port
Read-Only APIUncheckedAllow trading
Download open ordersCheckedSync orders
Send instrument-specificCheckedBetter data

Troubleshooting

Connection Refused

  • Verify TWS is running
  • Check API is enabled
  • Confirm port number matches

API Connection Drops

  • Disable auto-logoff in TWS
  • Check network stability
  • Restart TWS if needed

Next Steps

GuideDescription
Desktop Setup GuideComplete setup
Quick Start GuideStart trading
💡
Trading guides (2026):

Tip: IB Gateway is lighter than TWS for long-running API sessions, but it still requires IBKR's normal login/authentication flow.