Will automatic trading be realized based on Tongdaxin quantitative interface? (stock automatic order placement interface)

Usually, when developing a stock trading interface, it will include the research and development of multiple interface functions, so Tongdaxin's quantitative interface can realize automated trading. That is, through Tongdaxin's API interface (stock automatic order placement interface), it can realize the connection and interaction with the exchange, including functions such as placing orders, canceling orders, and querying account information. The specific forms are analyzed as follows.

The general steps for automated trading using the Tongdaxin quantitative interface are as follows:

1. Obtain Tongdaxin API interface: First, you need to obtain Tongdaxin API interface documents and related development tools from Tongdaxin official or other legal channels. The API interface of Tongdaxin mainly includes the market interface and the transaction interface. For example to analyze compatibility:

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. Development environment configuration: According to the API interface document, configure the development environment, including installing Tongdaxin software, configuring API connection parameters, installing related development tools and dependent libraries, etc.

3. Connect to the transaction server: connect to the transaction server of Tongdaxin through the API interface, and establish a connection with the exchange. During the connection process, correct login information and authentication parameters need to be provided.

4. Order/Cancellation: Use the functions or methods provided by the API interface to realize order placement and cancellation operations. You can place and cancel orders according to your own trading strategies and conditions.

5. Query account information: Use the functions or methods provided by the API interface to query account information such as positions and funds. Real-time account information can be obtained as needed. As follows:

sign

int Init();

Function

API initialization

parameter

none

return value

Number of trading accounts authorized successfully

When the return value is < 1, there is no need to call the Deinit interface, nor can you call other interfaces, otherwise an error will occur!

sign

void Deinit();

Function

API deinitialization

parameter

none

return value

none

sign

int Logon(const char* Ip, short Port, const char* Version, short Yybid, const char* Account, const char* TradeAccount,

const char* JyPassword, const char* TxPassword,

char* ErrorInfo);

Function

Login to trading account

parameter

Ip

Brokerage trading server IP, pay attention to distinguish between ordinary and financial

Port

Brokerage trading server port, pay attention to distinguish between ordinary and Liangrong

Version

The version number of the client, usually an empty string

6. Strategy execution: Write corresponding logic and algorithms according to your own trading strategy, judge and execute trading operations through market data. You can use the API interface functions provided by Tongdaxin to perform data analysis, calculate indicators, draw graphics and other operations.

It should be noted that when conducting automated trading, risk control, error handling and abnormal situation handling should be considered, such as setting stop loss and take profit, dealing with transaction failure, etc. At the same time, it is necessary to abide by relevant laws and regulations and avoid illegal operations.

To sum up, it is feasible to realize automated trading through Tongdaxin quantitative interface, but developers need to have relevant programming and quantitative trading knowledge, and follow relevant regulations and restrictions during use.

Guess you like

Origin blog.csdn.net/Q_121463726/article/details/132274173