Algorithmic trading allows you to take a defined trading plan and write a piece of software to execute that plan consistently. We will go over the steps to enable Interactive Brokers API to start algorithmic trading on the Interactive Brokers (IB) Platform. You should already have an IB account setup and configured your paper trading account for use in their Trader Workstation (TWS) platform.
Enable Interactive Brokers TWS API for Algorithmic Trading
Total time to complete about 5 minutes
Please start this configuration with your paper trading account.
- Launch Trader Workstation Application
After launching Trader Workstation select paper trading tab and login to the software.
- Open the Global Configuration Menu
Select File then Global Configuration in the top menu of trader workstation. - Configure API Settings for Algorithmic Trading
Expand the API section and select Settings menu.
Check “Enable ActiveX and Socket Clients” because we will be using a socket client connection to connect to the API.
Uncheck “Read-Only API” otherwise you will only be able to send any order into the system.
Set “Socket Port” to 7497. This can be customized to meet your requirements.
Check “Allow connections from localhost only”. This is an important setting because it only allows connections from the same computer TWS is running on. Otherwise you would add trusted IP addresses allowed to connect.
Click OK to save changes.