CTP integrated trading platform-post-development experience

Source: Internet
Author: User

In an intermittent year, I finally made the work of connecting to the futures trading platform into a product. The following are personal complaints.

1. Documentation

CTP has several documents, but it is too simple as a software development guide.

"API description of Integrated transaction platform", which is its API introduction. However, the description of the interface call context is missing, and the interface introduction is simple enough.

These two documents are displayed in the "special description of Integrated transaction platform transaction API" and "list of common issues in integrated transaction platform API development", and some Interface Usage specifications are finally displayed between the lines. However, some of the descriptions, such:

"11. Can the integrated trading platform show the depth of the market price? For example, 10 sales prices?

The Comprehensive trading platform is obtained from the remote seats of futures companies, and the remote seats allocated by the exchange to various futures companies

The seat can obtain data, and the comprehensive trading platform can be provided to customers of futures companies. Integrated transaction platform system enabling

You can log on to the exchange system with a remote seat from a futures company. The operation permissions on transactions and data come from futures companies.

Division. The previous period did not provide us with any help or tacit support from outside the market, but due to the strong comprehensive trading platform

Data processing capabilities provide futures investors with unlimited, in-depth market data that has been publicly available in the previous period.

Feasibility".

For example:

"32. The primary position in the position query record is an initial value before the opening of the current day and will not be reduced because of the flattening or liquidation.

Current hour's primary position = total position-current position. Ydposition: = position-todayposition".

I have.

2. Report status

If you want to obtain the real-time status of the report, go to onrtnorder!

If you want to be confused, check the status fields in onrtnorder!

For an already mature system, if you want to connect to CTP, It is an experience that makes people want to die.

Has the ticket been issued? The description in this document is as follows:

"If the user enters reqorderinsert, the system will immediately receive the onrsporderinsert response, indicating that the transaction system has received the report. After a ticket is submitted to the transaction system, if the transaction status of the ticket changes, the onrtnorder will be returned.".

Do you believe it? Let's take a look at the special instructions! You may get something like this:

"Thost received the report command. If it did not pass the parameter verification, it refused to accept the report command. The user will receive the onrsporderinsert message, which contains the error code and error message. If thost accepts the report command, the user will not receive the onrsporderinser, but will receive the onrtnorder, which is used to update the delegate status".

......

After reading this document, are you sure you are in the ticket status? Hey hey... You know, there are also a few pitfalls here.

You must have seen the following description:

"

/// All deals # define thost_ftdc_ost_alltraded '0'

/// Some transactions are still in the queue # define thost_ftdc_ost_parttradedqueueing '1'

/// Some transactions are not in the queue # define thost_ftdc_ost_parttradednotqueueing '2'
/// Not returned in the queue # define thost_ftdc_ost_notradequeueing '3'

/// No deal is in the queue # define thost_ftdc_ost_notradenotqueueing '4'

/// Withdraw the ticket # define thost_ftdc_ost_canceled '5'

/// Unknown, indicating that thost has accepted the user's delegated command and has not been forwarded to the exchange # define thost_ftdc_ost_unknown 'A'

/// Not triggered yet # define thost_ftdc_ost_nottouched 'B'

"

But this is not all. Check whether the following fields are displayed in the structure of the returned result of the callback.

/// Report the submission status of the ticket tthostftdcordersubmitstatustype ordersubmitstatus;

Right. Find the description about it. It may be more reliable to capture more data than to document.

3. Others

As for the settlement statement query, the position query and fund query are all pediatrics, and the prspinfo is really cute and hateful. Occasionally, a null pointer is nothing.

There is also the reward for receiving orders not from the local machine. I believe you will be pleasantly surprised by it.

 

Okay, that's all. Because the tone set for this time is spof, there is not much useful information. It is estimated that I will try again and write a system introduction, hoping to help a child who just started to develop the CTP program step on a few pitfalls.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.