Configuring the OKEx data provider
Last updated
Last updated
In order to connect to the trading servers of the OKEx exchange, you need to configure the OKEx data Provider in the TSLab program. Launch the TSLab program and wait for the software components and The trader's workspace to load. In the upper-left corner of the Workspace You will see the Data Providers window.
In this window, 4 data providers are prepared for You in advance:
Okex Perpetual Swap Real - data provider configured to work with the perpetual swap market;
Okex Spot Real - data provider configured to work with the spot market and margin market;
Okex Futures Real - a data provider, configured for futures markets;
DEMO Okex Spot -data provider configured to work with the OKEx demo server.
Select the appropriate data provider.
Please note! Trading on the Margin market is available after depositing funds to the Margin Account. To trade in "short", you need to "borrow money" from the exchange.
As an example, we will consider setting up the OKEx Spot Real data provider. Double-click on the selected data provider.
Fill in the required fields in the Data Provider Settings window:
API Public - public API key created in the OKEx merchant profile;
API Secret - secret API key created in the OKEx merchant profile;
Pass Phrase - code phrase from the API key.
Please note! TSLab team recommends to set the necessary settings of the data provider during its creation and configuration. Changing the settings of the data provider after its creation can lead to errors in its work.
Additional settings (optional):
Use local time - use time according to your regional settings of your computer.
Okex.SimulatedTrading - trading on the OKEx Demo server.
Okex.PaperTRealDataForSimulatedTradingrading - Enabling the use of quotes from the real market for simulated trading.
Subscribe to trades with quotes -Enables a subscription to the transactions on the instruments. which were ever requested from the View | Quotes window.
EnableDebugLogs -Enabling maximum data provider's logging. Enable it only if the TSLab support service has asked you to.
Orders blocking timeout (sec.) - Blocks the submission of requests for a set time interval after establishing a connection with the data provider.
Cache settings - The cache storage period settings allow you to specify how long your executed orders, transactions, and canceled orders will be stored.
Offline orders/Trades visibility - Enables visibility of your transactions in agents when the data provider is disabled.
Click OK to confirm the entered data.
In the Data Providers window, select the data provider that you entered credentials for. Click on the Key button located on the right.
In the Registration key window that opens, enter the key that was created for the data provider in the TSLab Merchant profile. Click OK.
After you enter the key, you will see the start button for the data provider in the Operation column. Click the button which establishes a connection.
The program will inform You about the connection status in the Data Providers window:
red color of the button indicates an error in setting up the connection,
yellow color of the button indicates the connection setup process,
green color indicates that the connection has been established and you can perform trading operations.
Please note! The Chart and Orders Manager are configured to work with the OKEx Spot Real data provider. After the OKEx Spot Real data provider is launched, the program will load the history from the OKEx server. The Chart will be updated. If you need to display data from another data provider on the Chart and Orders Manager, select the instrument you need in the Chart and Orders Manager settings.
OKEx exchange periodically conducts maintenance work. During maintenance there may be problems connecting the data provider to the OKEx exchange servers. Also in the Status bar TSLab you can see the message:
"Matching engine is being upgraded. Please try in about 1 minute."
For this reason, the TSLab team recommends that you set up a schedule for connecting to the data provider.
Using the Manage schedule menu you can configure the data provider to start automatically on the day and time you specify.
Please note! To automatically start the data provider, the TSLab application must be started.
To configure automatic startup of the provider click the button with the three dots in the Schedule Manager column.
In the Edit Schedule window that opens, fill in the schedule data for automatically starting the data provider. Click OK.
To launch the created schedule you need to click the button in the Schedule Manager column in the Data Providers window. In this case, manual management of the data provider startup will be blocked.
To disable the data provider, you need to disable the schedule by clicking the button in the Schedule Manager column.