A-share trading interface refers to the electronic interface or software system used to conduct stock trading transactions with domestic stock exchanges (Shanghai Stock Exchange and Shenzhen Stock Exchange). The A-share trading interface is one of the necessary operating skills for financial institutions, brokerages and individual investors. It provides real-time stock quotes, trading orders, cancellations, querying account information and other interface functions, which is convenient for investors to trade stocks operate.
The development of A-share trading interface mainly includes the following aspects:
1. Market View: Provide real-time stock market data, market order data, time-sharing charts, K-line charts and other relevant information to help investors keep abreast of the stock market situation.
For example, in terms of API functions:
name |
Function |
|
basic function |
Init |
|
Deinit |
||
Logon |
||
logoff |
||
QueryData |
||
QueryHistoryData |
||
SendOrder |
||
CancelOrder |
||
GetQuote |
||
Repay |
||
GetExpireDate |
||
Single Account Batch Function |
QueryDatas |
|
SendOrders |
||
CancelOrders |
||
GetQuotes |
||
Multi-account batch function |
QueryMultiAccountsDatas |
|
SendMultiAccountsOrders |
||
CancelMultiAccountsOrders |
||
GetMultiAccountsQuotes |
||
2. Trading orders: Through the trading interface, investors can place trading orders to buy or sell specified stocks, and set relevant trading parameters, such as price and quantity.
3. Fund management: Investors can query their own account fund balance, available purchase amount, position status, etc. through the interface, which facilitates fund management and decision-making.
4. Transaction query: Investors can query their own transaction status through the interface, including transaction price, transaction quantity and other information, to facilitate the management of transaction records.
For example:
sign |
void CancelOrders(int ClientId, const char* ExchangeId[], const char* EntrustId[], int Count, char* Result[], char* ErrorInfo[]); |
|
Function |
Batch cancellation of single account, distinguish each cancellation by subscript |
|
parameter |
ClientId |
Client ID |
ExchangeId[] |
Exchange Id array |
|
EntrustId[] |
Array of order IDs to be canceled |
|
Count |
The number of cancellation items, that is, the length of the array |
|
Result[] |
Cancellation result array, each result needs to allocate 1024*1024 bytes of space Please refer to [Result format] for the format |
|
ErrorInfo[] |
Error message array, each error message needs to allocate 256 bytes of space |
|
return value |
None, whether the cancellation of item i is successful or not is judged by whether ErrorInfo[i] is an empty string |
sign |
void CancelMultiAccountsOrders(int ClientId[], const char* ExchangeId[], const char* EntrustId[], int Count, char* Result[], char* ErrorInfo[]); |
|
Function |
Multi-account batch cancellation, distinguish each cancellation by subscript |
|
parameter |
ClientId[] |
ClientId array |
ExchangeId[] |
Exchange Id array |
|
EntrustId[] |
Array of order IDs to be canceled |
|
Count |
The number of cancellation items, that is, the length of the array |
|
Result[] |
Cancellation result array, each result needs to allocate 1024*1024 bytes of space Please refer to [Result format] for the format |
|
ErrorInfo[] |
Error message array, each error message needs to allocate 256 bytes of space |
|
return value |
None, whether the cancellation of item i is successful or not is judged by whether ErrorInfo[i] is an empty string |
sign |
void GetQuote(int ClientId, const char* Zqdm, char* Result, char* ErrorInfo); |
|
Function |
Get five quotes |
|
parameter |
ClientId |
Client ID |
Zqdm |
Securities code |
|
Result |
Query results, need to allocate 1024*1024 bytes of space Please refer to [Result format] for the format |
|
ErrorInfo |
Error message, need to allocate 256 bytes of space |
|
return value |
None, the success of the call is judged by whether ErrorInfo is an empty string |
5. Cancellation function: If an investor needs to cancel an unfilled order that has been placed, he can cancel the order through the trading interface. Generally, investors need to complete the configuration and installation of the interface according to the relevant information provided by the securities company after opening the securities account, so that they can normally use the trading interface for stock transactions.
因此,股票交易接口的开发是基于接口系统的性能来制定的,适应a股市场的灵活配置,以及运行,增加市场的活跃性。