Setting up the OKX data provider in TSLab

Setting up the OKX data provider in TSLab

To start working in TSLab, you need to select a data provider. From the Main Menu select Data - Add Online Data Provider

Note. You can also download historical data into the program. You can read more about working with Historical data in the section Historical data section.

Select the OKX data provider from the list and give it a name under which it will be saved in your provider list. Press Next button.

Fill in the required fields in the Data Provider Settings window:

  • API Public - a public API key created in your OKX personal account;

  • API Secret - a secret API key created in your OKX personal account;

  • Pass Phrase - API key passphrase.

To trade on a demo server, you need to select points:

  • Demo trading - trading on the OKX Demo Server;

  • Real data for Paper - enable the use of quotes from the real market in Demo trading.

Note! If you want to connect to the Demo account of the OKX exchange, you need to check the boxes in the menu item Demo trading. To trade on a demo account, you need to create a separate API Key on the OKX exchange website. Read more in the article: OKX demo account

Additional settings (optional):

  • Use local time - use the time in accordance with your computer's regional settings

  • Subscribe to trades with quotes - Includes subscription to trades for instruments that have ever been requested from the View | Quotes

  • Logs for Debug - Enable maximum data provider logging. Turn it on only if you were asked by the TSLab support service.

  • Orders blocking timeout (sec.) - Blocks the submission of orders for a specified time interval after establishing a connection with the data provider.

  • Cache settings - The cache retention period settings allow you to specify how long your executed orders, trades and canceled orders will be stored.

  • Offline orders/Trades visibility - Enables the visibility of your trades in agents when the data provider is turned off.

To confirm the entered data, click the OK button.

In the Data Providers window (Main menu - Data - Data Providers), select the created data provider and click the Key button. Enter the key created in your personal account on the TSLab website (TSLab Personal Account - Contracts), click the OK button.

Note! If you entered the key, but the input field is surrounded by a red frame, then an input error was made. Common causes of errors:

  • The key is copied manually and a space character is added at the beginning of the line, or at the end of the line

  • When creating a data provider in your personal account, a secret key was entered instead of a public API key, or extra characters were entered (for example, a space character)

  • If you have registered several data providers for the same exchange, check that you have copied the key for the corresponding provider from the Contracts section in your account

After the key has been entered, the button to launch the data provider in the Operation column will become available to you. Click the button to establish a connection.

The program will inform you about the connection status in the Data Providers window:

  • 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.

Last updated