TSLab
TSLab.proSupportTSLab LiveTSVerse
Eng
Eng
  • TSLab trading platform
  • For newbies
    • A beginner's guide
      • Purchasing a license key for a data provider
      • An example of connecting text quotes
      • Example of connecting a data provider to a broker / exchange
      • An example of creating a script in TSLab
      • An example of creating a trading algorithm in TSLab
  • Installing TSLab
    • TSLab Installation Guide
      • System requirements
      • TSLab Installation manual
    • Update TSLab
      • Preparing for update
      • Release build
      • Nightly build
    • Restarting the TSLab program
    • TSLab Changelog
      • TSLab 2.1 Changelog
      • TSLab 2.2 Changelog
        • 2.2.26.0 - 2024/01/31
        • 2.2.25.0 - 2024/01/17
        • 2.2.24.0 - 2024/12/04
        • 2.2.23.0 - 2024/09/19
        • 2.2.22.0 - 2024/08/30
        • 2.2.21.0 - 2024/05/17
        • 2.2.20.0 - 2024/05/15
        • 2.2.19.0 - 2024/02/21
        • 2.2.18.0 - 2024/02/09
        • 2.2.17.0 - 2023/11/16
        • 2.2.16.0 - 2023/10/20
        • 2.2.15.0 - 2023/10/13
        • 2.2.14.0 - 2023/08/11
        • 2.2.13.0 - 2023/05/12
        • 2.2.12.0 - 2023/02/28
        • 2.2.11.0 - 2022/12/15
        • 2.2.10.0 - 2022/10/27
        • 2.2.9.0 - 2022/09/16
        • 2.2.7.0 - 2022/06/23
        • 2.2.5.0 - 2022/04/29
        • 2.2.3.0 - 2022/04/01
        • 2.2.2.0 - 2021/12/29
  • Data providers
    • Cryptocurrency exchanges
      • Binance Cryptocurrency Exchange
        • Registration on Binance
          • Registration on Binance Exchange website
          • Configure Binance Wallet
          • Creating a Binance API Key for TSLab
          • Binance. Transferring USDT from wallet to wallet without commission
        • Registration on TSLab [Binance]
          • Account registration on the TSLab website [Binance]
          • Creating a free Binance Data Provider for TSLab
        • Setting up a Binance Data Provider in TSLab
        • TSLab Binance Edition
          • Starting the program
          • Configuring the Binance Data provider
      • Bitget Cryptocurrency Exchange
        • Registration on the Bitget official website
        • Creating a Free Bitget Data Provider
        • Configuring the Bitget Data Provider in TSLab
      • ByBit Cryptocurrency Exchange
        • Registration on the ByBit website
        • Creating a free ByBit data provider
        • Configuring the ByBit Data Provider in TSLab
      • Deribit Cryptocurrency Exchange
        • Deribit data provider settings
        • Deribit. Frequently asked questions and useful information
        • Deribit. Possible problems and solutions
        • Deribit Margin Requirements Calculation
        • An example of a ready-made script for Deribit
      • Kucoin Cryptocurrency Exchange
        • Registration on the KuCoin official website
        • Creating an API key on the KuCoin website
        • Issuing a free license for KuCoin Data Provider
        • Setting up the KuCoin data provider in TSLab
      • OKX Cryptocurrency Exchange
        • Setting up an OKX account
          • Registration on the OKX website
          • OKX API Key creation
          • Issuing a free license for OKX Data Provider
          • Setting up the OKX data provider in TSLab
          • OKX demo account
        • TSLab OKX Edition
          • First launch of TSLab OKEx Edition
          • Configuring the OKEx data provider
          • Trading in TSLab [OKEx]
          • OKEx Demo
    • Historical Data
      • YahooFinance
      • Offline data provider in CSV format
      • An example of connecting text quotes
      • Text files with historical data
    • Interactive Brokers
      • Getting Started with Interactive Brokers Data Provider
        • Installing and configuring the Trader Workstation (TWS) terminal
        • Installing and configuring the IB Gateway terminal
      • Features of working with Interactive Brokers data provider
      • Known issues for Interactive Brokers Data Provider
      • Loading instruments in a package
  • Working with the program
    • Main menu
      • File
        • Program Settings
      • View
        • Chart
          • Features of working with the Chart in TSLab
          • Chart Controls
        • Depth of Market
        • Quotes
        • All Trades
      • Data
        • Data Providers window
        • Add online data provider
        • Add offline data provider
      • Lab
        • Scripts window
          • Script Container
      • Trading
        • Accounts window
        • Positions window
        • My trades window
        • My orders window
          • Move orders and deals to an agent
        • Autotrading Control Center window
          • Agent window
          • Agent trading settings
            • Event recalculations
            • Slippage
          • "Forget errors" of the agent
        • Orders manager
          • Linking a manually completed order to an agent
        • Agent Control Center window
      • Tools
        • Data backup and recovery
        • Notifications manager
          • Notifications Manager Filters
          • Reference List of Service Message Numbers
          • Example of setting up notifications for Gmail
        • Export to Excel
    • Common interface
      • Status bar
      • Tab
      • Workspace
      • Spreadsheets
    • Visual editor
      • Toolbar
        • Compress and Decompress Blocks
      • List of visual blocks
        • Service Elements
        • Cycles
        • TSChannel
      • The syntax of the Formula, Boolean expression and String expression blocks.
    • Autotrading Control Center
      • Agent trade settings
        • Agent trade settings - Placing orders
        • Agent trading settings - Script execution
        • Agent trading settings - Events
    • TSLab API
      • API Introduction
        • Visual Studio Installation
        • First script (API)
        • First Indicator (API)
        • Script Debugging
        • Logging
      • Writing scripts on the API
        • Trading Instrument Data
        • Working with positions
        • List of deals
        • The order queue
        • Standard Indicators and Handlers
        • Script parameters
        • Caching
        • Local and global cache
        • Multiple Tools
      • Writing indicators on the API
        • Stream indicator
        • Bar indicator
        • Pre-processed indicator
        • Indicator with multiple calculations
      • Additional features
        • The ability to create your own optimizers *
        • C ++ / CLI script
        • API Control Panel
        • Result from script
        • * Оптимизация. Пул массивов.
      • Examples
        • Get script results
        • Get script parameters
        • Get script and agent settings
        • Get position balance (net worth)
        • An example of a strategy Breakout of the Donchian channel
        • Example of a Moving Average Crossover strategy
        • Indicator example
        • How to speed up the processing of a script on the API
        • Links to examples
      • Question - Answer
        • HandlerParameter Attribute
    • Optimization
      • Insufficient load on a multicore processor
  • Examples of scripts and indicators
    • Examples of algorithms and indicators
    • Examples of implementing strategies in TSLab
      • A trading system based on indicator CCI
      • A trading system based on Standard Deviation
      • A trading system based on Aroon
      • A trading system based on ADX and DI technical indicators
      • A trading system based on the RSI indicator
      • Example of a trading strategy without parameters
  • TSLab website
    • TSLab Support Service
      • Memory dump of TSLab application
      • TSLab program log files
Powered by GitBook
LogoLogo

Мы в соцсетях

  • Группа в Telegram
  • Новости TSLab
  • Vkontakte
  • YouTube канал TSLab Live

Наши веб-сайты

  • TSLab
  • Служба поддержки
On this page
  • Trader Workstation (TWS) and IB Gateway terminals
  • Subscribing to an Interactive Brokers Data Provider
  • Configuring the Interactive Brokers Data Provider in TSLab
  • Create a new data provider
  • Data provider settings
  • Entering a license key and connecting to a data provider

Was this helpful?

Export as PDF
  1. Data providers
  2. Interactive Brokers

Getting Started with Interactive Brokers Data Provider

Last updated 2 years ago

Was this helpful?

Trader Workstation (TWS) and IB Gateway terminals

In order to connect the TSLab program to Interactive Brokers, you need to install the Trader Workstation (TWS) terminal or IB Gateway on the computer where the TSLab program will be installed.

Instructions for installing and configuring TWS and IB Gateway terminals

Subscribing to an Interactive Brokers Data Provider

Enter the Cabinet on the TSLab website.

In the Shop section, find the Interactive Brokers data provider. To select a data provider, click the Details button.

Note! When placing an order, you must provide your Interactive Brokers account number. The account number can be found in the TWS terminal. The number has the following notation format:

  • D0000000 - for real account

  • DU0000000 - for demo account

Complete the Interactive Brokers data provider subscription form.

  1. Enter your Interactive Brokers account number.

  2. Specify the key expiration date for the data provider.

  3. Confirm the User Agreement.

  4. Click on the Purchase button. Complete the license process by paying the invoice.

After the license registration process is completed, an email with a license key will be sent to your email address. Also, the key can be found in the Contracts section. In order to get detailed information about the contract, click on the button with three dots in the line with the contract.

The window that opens provides detailed information about the contract, including the expiration date, account number, and key for the data provider.

Note! The generated key is only suitable for the specified account number. If you want to use the Interactive Brokers Data Provider for another brokerage account, you will need to create a new key.

Configuring the Interactive Brokers Data Provider in TSLab

Download and install the TSLab trading platform. You can download the latest version of the program by clicking on the link:

Create a new data provider

Launch the TSLab program. To connect to Interactive Brokers, you must set up a data provider. In the main menu of the program, select the menu item Data -> Data Providers.

In the Data Providers window that opens, click the Add button. Select provider category Online data. Press Next.

Next, in the list of providers, you need to find and select Interactive Brokers. Enter the name of the provider, which will later be displayed in the "Data Providers" window. Press Next.

Data provider settings

In the data provider settings window that opens, enter the IB user account number.

The user account is displayed:

  • For the IB Gateway terminal - in the Settings window of the IB Gateway terminal.

  • For the TWS terminal - in the title bar of the main window of the TWS terminal

After setting up the Interactive Brokers data provider, click the Next button.

Menu item
Description

Contracts Manager

Allows you to add and remove securities (contracts).

Account

Interactive Brokers client account.

Alternative provider

Alternative data provider.

API ID

The unique API ID of the program by which the Interactive Brokers client interacts with the TWS terminal. The API ID is set by the client.

Host

The IP address of the computer running TWS.

Port

Port number.

Use local time

Allows you to output data in the local time zone, UTC is used by default.

Orders outside RTH

Activates the placement and execution of orders outside the exchange session

Use SMART always

Enables the use of the SMART site.

Use limit orders instead of market

Disables the use of the "Order by Market" broker. Activates a Limit order at the last known price +- 4%

Percentage of limit price increase

Percentage increase in price for an order when limit orders are used instead of market orders

Load trades for (max) days

Download missed ticks for N days

Load trades

Load trades when connected. If disabled, it will not load ticks.

Orders blocking timeout (sec.)

Blocks the submission of requests for a set time interval after establishing a connection with the data provider.

Cache settings

Sets the period for storing information about your transactions and orders, the following options are available:

  • executed order cache period;

  • cancelled order cache period;

  • trade cache period.

Offline orders/ Trades visibility

Activates the ability to see your deals and orders offline. Changing this parameter requires restarting the program.

Entering a license key and connecting to a data provider

Next, you need to enter the license key for the created data provider. Select the Interactive Brokers provider and click the Key button. In the Registration Key window, enter the key sent to you by mail (or copy the key from your TSLab personal account). Click on the OK button.

If the key is entered correctly, then in the Comment column the license validity period will be displayed, and in the Operation column, the button to connect to the exchange will become available to you.

Attention!

Before connecting to the Interactive Brokers data provider, you need to set up Trader Workstation (TWS) and IB Gateway terminals

Check the work of the supplier by clicking on the button in the Operation column. The program will inform you about the connection status in the Data Provider window and in the status bar:

  • red color of the button means an error in establishing connection,

  • yellow color means that the connection is in progress,

  • green color means that connections have been established and you can carry out trading operations.

Check the box in the Status bar column to activate the slider button in the Status bar. The color of the slider button in the Status bar also informs you about the connection status.

Using the Schedule manager menu, you can configure the automatic start of the data provider on the day and time you specify.

Note. To start the data provider automatically, the TSLab application must be running.

To configure the automatic start of the provider, click on the button with three dots in the Schedule manager column.

In the Edit Schedule window that opens, fill in the data for the provider's automatic launch schedule. Click on the OK button

To start the created schedule, in the Providers window, move the Schedule manager slider to the extreme right position. In this case, manual control of the launch of the data provider will be blocked.

Installing and configuring the Trader Workstation (TWS) terminal
Installing and configuring the IB Gateway terminal
Trade System LaboratoryTrade System Laboratory
Trade System LaboratoryTrade System Laboratory
Logo
Logo