The C interface of stock trading may contain multiple call functions, and the specific call function depends on the interface specification used and the requirements of the exchange. Let's take a look at the following examples of some possible common stock trading C interface call functions:
1. Connect function (Connect): used to establish a network connection with the exchange.
2. Login function (Login): used to authenticate and log in to the exchange system.
3. Inquiry function (GetMarketData): used to obtain stock market data, such as stock quotes, index quotes, etc.
4. Fund query function (GetAccountInfo): used to query the user's fund balance, available funds, position information, etc.
For batch query and acquisition of multiple accounts:
sign |
void GetMultiAccountsQuotes(int ClientId[], const char* Zqdm[], int Count, char* Result[], char* ErrorInfo[]); |
|
Function |
Get five quotations in batches from multiple accounts, and distinguish each query by subscript |
|
parameter |
ClientId[] |
ClientId array |
zqdm[] |
Security code array |
|
Count |
The number of query items, that is, the length of the array |
|
Result[] |
Query 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 i-th query is successful or not is judged by whether ErrorInfo[i] is an empty string |
5. Buy function (BuyOrder): used to send an order to buy stocks.
6. Sell function (SellOrder): used to send an order to sell stocks.
7. Cancellation function (CancelOrder): used to cancel the unexecuted buy or sell order.
8. Inquiry transaction function (GetTradeInfo): used to inquire about the order information that has been executed.
9. Query position function (GetPositionInfo): Used to query the stock information of the current position.
Please note that the above functions are examples only, and the specific calling functions may vary depending on exchanges and interface specifications. When analyzing the C interface of stock trading, it is necessary to refer to the interface documents and sample codes provided by the exchange to understand the specific function calling methods and parameter settings. Like source code documentation: MetaTradeAPI (metatradeapi) - Gitee.com