User Guide

1)Read the official website interface instruction manual, examples and rules such as data volume calculation and account permissions; 2)Download Windows SDK installation package to login Supercommand (or use official website version of Supercommand). View interface indicators and generate fetch command; 3)SDK interface is initialized according to the following instructions (HTTP interface does not need to be initialized); 4)Please use the data interface account to login in the development environment ; 5)Please retrieve data through fetch command execution in the development environment;

Introduction to Supercommand Client

Users can view the indicators supported by the interface through the Supercommand client and assist in generating interface extraction commands.

  1. Windows version Supercommand terminal

1)Download SDK interface Windows installation package extract and double-click SuperCommand.exe to open the super command client;

img.png

2)Index query and command generation mode;

Select language

img_1.png

Selection function, security type

img_2.png

Select Code, Index, Index Parameter Generation Command

img_3.png

Click OK to generate an interface command

img_4.png

  1. Web version Supercommand

Address: quantapi.10jqka.com.cn/gwstatic/static/ds_web/super-command-web/index.html

SDK Interface Environment Repair Instructions

SDK Interface Windows Environment Deployment

After downloading Windows SDK installation package, login to Supercommand client-tools-environment settings for environment repair

img_5.png

Note: Before environment repair, users need to have a development environment corresponding to the language. This step will not help users install.

Python

Method 1: Super Command Terminal Environment Repair

1)Select Python Language Click OK

img_6.png

2)Select the Python version path used to fix

img_7.png

If you don't recognize the Python version or virtual environment path you are currently using, click 'Add Path' to manually add a fix; If you don't know which Python path you're currently using, you can run the following command in the development tool you're using:

python
import sys

print(sys.executable)

img_8.png

3)Click continue after the program will automatically repair, click to display the desktop if the following prompt box appears: repair success, click OK to complete the repair.

img_9.png

After successful repair, the file iFinDPy.pth will be generated in the Python directory: Lib\site-packages folder, and the content of the file is the path of the local interface package.

Note: Some users have newly installed Python versions and have not installed any Python libraries. There is no Lib\site-packages folder. In this case, you need to manually add the Lib\site-packages folder and then perform environmental repair to succeed.

img_10.png

4)After successful repair, you can test the interface in the development software (it is recommended to restart Spyder, PyCharm and other development tools after repair. If you do not restart, you may report an error)

img_11.png

Method 2: pip Package Management Install Interface Package

1)Install the interface package command: pip install iFinDAPI

img_12.png

As shown in the screenshot above, after the installation command is successfully executed, check the Python version package path used: Lib\site-packages directory

img_13.png

As shown in the screenshot above, if there is iFinDAPI related directory description, the installation is successful

2)Update interface pack command:

text
pip install --upgrade iFinDAPI

MATLAB

1)Select MATLAB Language Click OK

img_14.png

2)Select the MATLAB version path used for repair

img_15.png

If no path is identified, click Add Path Manually

3)Click Continue and the program will automatically repair. Click to display the following reminder box on the desktop to indicate successful repair. Click OK to complete repair.

img_16.png

4)After successful repair, you can test the interface in MATLAB

img_17.png

Java

1)Select Java Language Click OK

img_18.png

2)Select the Java version path used for repair

img_19.png

3)Click Continue and the program will automatically repair. Click to display the following reminder box on the desktop to indicate successful repair. Click OK to complete repair.

img_20.png

4)Jar package import path 64 bit: THSDataInterface_Windows\bin\x64\ThsJDI.jar 32 bit: THSDataInterface_Windows\bin\x86\ThsJDI.jar

img_21.png

5)After successful repair, you can use the official website example to modify the test interface

img_22.png

img_23.png

R

1)Select R Language Click OK

img_24.png

2)Select the R version path currently in use for repair

img_25.png

3)After selecting Continue, the program will automatically repair. Click to display the desktop and the following reminder box will appear. Click OK to complete the repair.

img_26.png

4)After successful repair, you can test the interface in R.

img_27.png

VBA

1)Select VBA Language Click OK

img_28.png

2)Select VBA path to repair

img_29.png

3)After selecting Continue, the program will automatically repair. Click to display the desktop and the following reminder box will appear. Click OK to complete the repair.

img_30.png

4)After successful repair, interface test can be carried out

img_31.png

img_32.png

C#

1)C#language does not need to be repaired in the terminal, directly view the official website application example (C#interface function use case) 2)Modify local path of interface installation package, fill in account number and password

img_33.png

3)Modify the required function command execution

img_34.png

img_35.png

img_36.png

C++

1)C++ language also does not need to be repaired in the terminal, directly view the official website application example 2)Modify local path of interface installation package, fill in account number and password

img_37.png

img_38.png

3)Modify the required function command execution

img_39.png

img_40.png

SDK Interface Linux Environment Deployment

Before calling, you must use ldd libShellExport.so, ldd libFTDataInterface.so and ldd hqdatafeed in the decompressed interface directory to check whether the environment on which the interface library depends is complete. If it is not complete, please use yum or apt-get to install (the following instructions take Ubuntu environment as an example), as follows:

text
Centos: sudo yum install -y libgcc.i686 zlib.i686 glibc.i686 libstdc++-devel.i686
Ubuntu: sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

1)If the following 'not found' error occurs, install according to the missing error

img_41.png

2)Common missing libidn.so.11 error installation

You can search libidn and install:

text
查找:apt-cache search libidn  
安装:sudo apt install libidn-dev

img_42.png

After installation, such as ldd libFTDataInterface.so to check whether the environment depends or is missing, it may be that the installation location is wrong.

After installation, such as ldd libFTDataInterface.so to check whether the environment depends or is missing, it may be that the installation location is wrong. Search for:

text
sudo find / | grep libidn.so

libidn.so.11 can be seen in the directory: /snap/core18/2538/lib/x86_64-linux-gnu/ Move the file to the directory of other files found by ldd: /lib/x86_64-linux-gnu/

text
命令:sudo cp /snap/core18/2538/lib/x86_64-linux-gnu/libidn.so.11 /lib/x86_64-linux-gnu

img_43.png

Python

1)After the environment dependency query is complete according to the above instructions, call installiFinDPy.py in the interface directory to install

For example: the interface compression package is decompressed and placed in the/lib directory 32-bit call installiFinDPy.py installation in the bin directory of the interface, input parameters are the file path after file decompression For example: zip decompression package is placed in/lib directory

text
Sudo  python  /lib/bin/installiFinDPy.py  /lib

64-bit call interface installiFinDPy.py installation in bin64 directory, input parameter is the file path after file decompression For example: zip decompression package is placed in/lib directory

text
Sudo  python  /lib/bin64/installiFinDPy.py  /lib

img_44.png

2)Test the use of interfaces after the environment is deployed

img_45.png

Java

1)According to the above instructions, after the environment dependency query is complete, before compiling and using, please add the current directory to the system environment variable LD_LIBRARY_PATH (because this program uses configuration files, do not copy to the system directory, otherwise it will lead to data exception), such as bin64 after decompression is located in the directory/root/Linux

Java
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/Linux/bin64

2)Modify Sample Code Login Function, Extract Data Command Function Test

img_46.png

3)Introduce jar package and test with sample code For example, the java directory after decompression is/root/Linux The commands are as follows (note the spaces between commands):

Java
javac -cp /root/Linux/java/Ths/output/ThsJDI.jar test.java
java -cp /root/Linux/java/Ths/output/ThsJDI.jar: test

img_47.png

C++

1)Follow the above instructions and download the official website example to modify the test after the environment dependency query is complete. 2)Unzip linux installation packages and C++ examples

img_48.png

3)Modify example, fill in account number, password

img_49.png

4)Add an interface directory to the system environment variable (bin64 directory for example)

img_50.png

5)Compile and test interface examples

img_51.png

HTTP Interface Instructions

HTTP Interface Description

Refresh Token and Access Token Description

Interface authentication schemes are divided into long-term refresh_token and short-term access_token

refresh_token: Used to obtain the latest valid access_token value;

access_token: Used to obtain specific function data.

  1. Refresh Token

The refresh_token validity period is the same as the validity period of the account when it was acquired (subsequent account renewal, permission change must be re-acquired to update the refresh token validity period). refresh_token is used only to request the currently valid access_token or to obtain a new access_token. Refresh_token can only be obtained via the super command client "Tools-refresh_token query".

img_52.png

After refresh token is updated, refresh_token and access_token of all environment will be invalid.

  1. Access Token

The access_token can be obtained by using the interface function refresh token, and expires seven days after the initial generation. For example, retrieving the access_token three days before the expiration will refresh the expiration time. Access_token is used to request data directly from the flush server. Single access_token supports up to 20 IPs. If the error 'Device exceeded limit' is reported, the access token can be updated to reset the binding.

Tools such as Postman Use HTTP Interfaces

Get Access Token

Supercommand select HTTP interface command to generate get_access_token function

img_53.png

img_54.png

img_55.png

After obtaining the refresh token, use the interface to obtain the latest access token.

img_56.png

Retrieve Data

Supercommand view fetch function command

img_57.png

Fill in parameters to get data

img_58.png

img_59.png

Language Environments such as Python Use HTTP Interfaces

You can refer to the official website example test-HTTP interface application case (python environment)

Get Access Token

img_60.png

Retrieve Data

img_61.png

Interface Whitelist and Proxy Settings

Open Interface Domain Name or IP Whitelist

Some users cannot directly connect to the public network due to the company's network security restrictions. They need to add the interface domain name or IP to the whitelist before using the interface network. Otherwise, the login interface will report an error-340 Network unavailable:

Open the interface domain name or IP whitelist as follows:

domain nameIPportexplain
quantapi.51ifind.com121.52.252.1580、443Primary domain name
ft.10jqka.com.cn58.220.49.15080、443Alternate domain name
download.10jqka.com.cn61.136.165.24080、443Supercommand automatic upgrade
119.12.174.130443Overseas special line (the following can only be opened by overseas users)
119.13.107.34443Overseas Line (alternate)
119.8.60.12880、443Overseas installation package, upgrade package download server IP

Note: It is recommended to open a domain name. Because the IP address corresponding to the domain name is not fixed, it must be cache IP first. If the user can only set IP, after opening the interface IP whitelist, you need to set it in the local device hosts.

Interface Settings Agent

Windows Environment Settings

1)After extracting Windows installation package, open interface super command client:

img_63.png

2)Click the Settings icon on the login interface:

img_64.png

3)Select agent type and fill in agent information:

img_66.png

Note: Select 'HTTP proxy' for your own proxy server, proxy server address and port are required, account number and password can be left blank if not set; special line proxy users contact customer manager for consultation.

Linux Environment Settings

Linux environment proxy settings need to be manually modified configuration file system_setting.ini

system_setting.ini Path: 64-bit directory: bin64\Tool\etc\system_setting.ini 32-bit directory: bin\Tool\etc\system_setting.ini

text
Add as follows:
[System]
proxy=1           //Control whether proxies are used. 1 means using a proxy; 0 means not using a proxy
ip=10.0.16.237    //Proxy server ip
port=802          //Proxy Service Port
type=http         //Proxy type, currently only supports http
user=User         //Proxy Service Identity Verification Account
password=123456   //Proxy service identity verification password