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.
- Windows version Supercommand terminal
1)Download SDK interface Windows installation package extract and double-click SuperCommand.exe to open the super command client;
2)Index query and command generation mode;
Select language
Selection function, security type
Select Code, Index, Index Parameter Generation Command
Click OK to generate an interface command
- 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
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
2)Select the Python version path used to fix
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:
import sys
print(sys.executable)
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.
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.
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)
Method 2: pip Package Management Install Interface Package
1)Install the interface package command: pip install iFinDAPI
As shown in the screenshot above, after the installation command is successfully executed, check the Python version package path used: Lib\site-packages directory
As shown in the screenshot above, if there is iFinDAPI related directory description, the installation is successful
2)Update interface pack command:
pip install --upgrade iFinDAPI
MATLAB
1)Select MATLAB Language Click OK
2)Select the MATLAB version path used for repair
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.
4)After successful repair, you can test the interface in MATLAB
Java
1)Select Java Language Click OK
2)Select the Java version path used for repair
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.
4)Jar package import path 64 bit: THSDataInterface_Windows\bin\x64\ThsJDI.jar 32 bit: THSDataInterface_Windows\bin\x86\ThsJDI.jar
5)After successful repair, you can use the official website example to modify the test interface
R
1)Select R Language Click OK
2)Select the R version path currently in use for repair
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.
4)After successful repair, you can test the interface in R.
VBA
1)Select VBA Language Click OK
2)Select VBA path to repair
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.
4)After successful repair, interface test can be carried out
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
3)Modify the required function command execution
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
3)Modify the required function command execution
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:
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
2)Common missing libidn.so.11 error installation
You can search libidn and install:
查找:apt-cache search libidn
安装:sudo apt install libidn-dev
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:
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/
命令:sudo cp /snap/core18/2538/lib/x86_64-linux-gnu/libidn.so.11 /lib/x86_64-linux-gnu
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
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
Sudo python /lib/bin64/installiFinDPy.py /lib
2)Test the use of interfaces after the environment is deployed
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
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/Linux/bin64
2)Modify Sample Code Login Function, Extract Data Command Function Test
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):
javac -cp /root/Linux/java/Ths/output/ThsJDI.jar test.java
java -cp /root/Linux/java/Ths/output/ThsJDI.jar: test
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
3)Modify example, fill in account number, password
4)Add an interface directory to the system environment variable (bin64 directory for example)
5)Compile and test interface examples
HTTP Interface Instructions
HTTP Interface Description
Refresh Token and Access Token Description
The authentication scheme consists of a long-term refresh_token and a short-term access_token.
refresh_token: Used to obtain the latest valid access_token.
access_token: Used to retrieve specific function data.
- refresh token The refresh token is long-term valid. Its expiration date aligns with the account’s expiration date at the time of retrieval. If the account is renewed or its permissions change (e.g., a free or trial account is upgraded to a formal account), the refresh token must be re-obtained to update permissions.
The refresh_token is only used to request the currently valid access_token or to obtain a new access_token.
The refresh_token can be retrieved via the super command client under "Tools - Refresh Token Query," or through the web version of the super command under Account Details at: https://quantapi.10jqka.com.cn/gwstatic/static/ds_web/super-command-web/index.html#/AccountDetails.
After the refresh token is updated, all previously issued refresh_tokens and access_tokens in all environments will become invalid.
- access token The access_token is valid for 7 days. Within this period, calling the get_access_token function will return the same access_token with an unchanged expiration date. After 7 days, when the token expires, calling the get_access_token function will generate a new access_token with its validity extended by another 7 days.
A single access_token supports a maximum of 20 IP addresses. If the error "Device exceed limit" occurs, the access token can be updated to reset the bindings.
Tools such as Postman Use HTTP Interfaces
Get Access Token
Supercommand select HTTP interface command to generate get_access_token function
After obtaining the refresh token, use the interface to obtain the latest access token.
Retrieve Data
Supercommand view fetch function command
Fill in parameters to get data
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
Retrieve Data
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 name | IP | port | explain |
---|---|---|---|
quantapi.51ifind.com | 121.52.252.15 | 80、443 | Primary domain name |
ft.10jqka.com.cn | 58.220.49.150 | 80、443 | Alternate domain name |
download.10jqka.com.cn | 61.136.165.240 | 80、443 | Supercommand automatic upgrade |
119.12.174.130 | 443 | Overseas special line (the following can only be opened by overseas users) | |
119.13.107.34 | 443 | Overseas Line (alternate) | |
119.8.60.128 | 80、443 | Overseas 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:
2)Click the Settings icon on the login interface:
3)Select agent type and fill in agent information:
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
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