Analysis on the Development Principle of C-Interface for Stock Trading

The development and use of the c-interface for stock trading is based on the principle of automatic order placement based on stock market software data, and then integrates information as the basis of trading strategies. All trading behaviors are automated. Moreover, when traders use the c interface of stock trading, it is actually written by code. In this respect, java language, Python, c language, etc. can be used for development. In this regard, next, the editor will talk about the development concept related to the stock trading interface , so that more traders can master the interface principle, carry out secondary development, or master the knowledge of these quantitative transactions.

For example, the development document of the stock trading c interface:

(1) Description of stock interface API call: 

name

Function

basic function

Init

API initialization

Deinit

API deinitialization

Logon

Login to trading account

logoff

Log out of trading account

QueryData

Query various transaction data

QueryHistoryData

Query various historical data

SendOrder

Order

CancelOrder

Order Cancellation

GetQuote

Get five quotes

Repay

Margin and securities lending account direct repayment

GetExpireDate

Query API authorization expiration date

Single Account Batch Function

QueryDatas

Single-account batch query of various transaction data

SendOrders

Single account batch order

CancelOrders

Single account batch cancellation

GetQuotes

Get five quotes in batches for a single account

Multi-account batch function

QueryMultiAccountsDatas

Multi-account batch query of various transaction data

SendMultiAccountsOrders

Batch orders for multiple accounts

CancelMultiAccountsOrders

Multi-account batch cancellation

GetMultiAccountsQuotes

Get five quotes in batches for multiple accounts

(2) The principle of transaction interface querying various transaction data:

sign

void QueryData(int

ClientId, int Category,

char* Result, char*

ErrorInfo);

Function

Query various transaction data

parameter

ClientId

Client ID

Category

Query Information Category

0: Funds, 1: Shares, 2: Order of the day, 3: Transaction of the day, 4: Cancellation order,

5: Shareholder code, 6: Financing balance, 7: Securities lending balance, 8: Marginable securities,

9: Different securities companies, 10-11: None, 12: Inquiry about new shares available for subscription, 13: Inquiry about subscription quota for new shares,

14: Matching Number Query, 15: Winning Lottery Query

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, whether the query is successful or not is judged by whether ErrorInfo is an empty string

The header file type of the stock trading c interface development document:

public int getResultCode() {
  return this.resultCode;
 }
 
 public void setResultCode(int value) {
  this.resultCode = value;
 }
 
 public String getResultMsg() {
  return this.resultMsg;
 }
 
 public void setResultMsg(String value) {
  this.resultMsg = value;
 }

In other words, the stock trading c interface can also mine various data languages, but if you want to obtain subdivided data, you can develop the program through programming, and just input it directly. It plays a very important role in the automatic trading process in the quantitative field. key role.

Guess you like

Origin blog.csdn.net/Q_121463726/article/details/128338057#comments_24610371