Interactiv Brokers

Interactive Brokers

To use TSLab via Interactive Brokers you need to install the latest Trader Workstation (TWS) on your PC first. Once the station is installed, proceed with setting up Interactive Brokers as your data provider in the Data Manager window.
Installing TWS
Install the latest Trader Workstation (TWS) on your PC first.
Make sure that you have the Java plug-in (version 1.7 or higher) installed on your PC before you begin installing TWS. Use the foolowing link to check which version of Java you are running - Or you may follow the instruction provided by Interactive Brokers -
Attention! If you are upgrading to Java 1.7, you should remove all existing Java components from your PC first.
Once the installation process is completed, launch TWS. Enter your username and password.
Click Edit in the Main Menu and select Global Configuration. Set up TWS according to this sample below.
Atention! ID of the main API-client and IP should coincide with TSLab setup settings. If these settings do not coincide, your orders, placed in TWS, cannot be seen in TSLab.
Setting up Interactive Brokers as your Data Provider
Now you need to set up Interactive Brokers as your data provider in the Data Manager window (Main Menu l Data l Data Manager).
Push the Add button to open the dialog window of the Setup Wizard. Select online data.
Type a unique name of your data provider. This name will be displayed later in the Data Manager window and in messages. Push Next.
Type in an IB User's account number in the next dialog box. Your account number is always displayed in the TWS main window caption.
Contracts Manager
Allows to add and remove contracts (instruments).
An Interactive Brokers user's account.
Alternative provider
An Alternative market data provider.
A unique API ID of the program, which an Interactive Brokers user applies working with TWS. API ID is set by a user himself.
An IP address of a PC where TWS is applied.
The port number.
Use local time
Allows to receive data in a local time zone. UTC is applied in default settings.
Cache settings
Sets up a time period during which information about (1) executed orders, (2) canceled orders or (3) trades should be kept.
Offline orders / trades visibility
Activates keeping information about your orders and trades when you are offline. Activating this option requires TSLab restart.
Now push the Key button and type your key in the entry filed. Use the following link to receive a key with the help of your IB account number -
A new data provider appears in the data providers table. The data provider line shows a key expiration date. The Connect button gets enabled.

Using TSLab via Interactive Brokers

At the moment TSLab cannot read IB contracts (instruments).
To have a contract (instrument) in your cached contracts list, you should type a ticker of an instrument (contract) in the corresponding field of the Contracts Manager window. In the same window you should enter a name of a market or select it from the list of the available ones, then select an instrument type (contract). To specify a contract, you may apply values in the Currency and Expiry entry fields. Expiration date should have a YYYYMM format.
Attention! Working with futures you should always apply expiration date and use an underlying asset instead of a ticker. E.g. Use the PL underlying asset and the 201501 expiration date for the PFL5 futures .
With necessary contract properties entered, you can add this instrument (contract) into a cached contract list by pushing the Add contract button. Use Delete contract button to delete a contract from your list.
You can also place an order involving a desired instrument in TWS and cancel it immediately to get this contract (instrument) cached by TSLab. The contract (instrument) gets into your TSLab cached contract list.
Last modified 4mo ago