Configure the Connecting Socket Port
- Launch Trader Workstation or IB Gateway
- Open the Windows File Explorer
- Navigate to
C:\TWS API\samples\DdeSocketBridge - Right click the “runDdeSocketBridge.bat” file.
- Click Edit from the list. This will open a new Notepad window.
- NOTE: Windows 11 users may need to choose “Show more options” first.
- On the third line after “DdeSocketBridge.jar” add -p followed by whichever socket port you have specified in TWS or IB Gateway.
The default ports supplied by Interactive Brokers are as follows:
- TWS Live Account: 7496 (Socket Bridge’s default value)
- TWS Paper Account: 7497
- IB Gateway Live Account: 4001
- IB Gateway Paper Account: 4002

