Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the basic knowledge points of CTP programmed transaction?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Today, the editor will share with you the relevant knowledge points about the introduction to CTP programmed transactions, which are detailed in content and clear in logic. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.

I. brief introduction of counter system

Fig. 1 schematic diagram of programmed transaction link

According to the domestic regulatory requirements, customers can not directly connect to the exchange system, the middle must go through the futures company (Broker) system, which is the counter system.

Futures companies will have a number of counter systems, which can be functionally divided into chairman and sub-desk systems. Chairman of the system is fully functional, support in and out, after-market settlement, etc., pay attention to high throughput and high reliability, general customers are trading on the chairman system.

For example, CTP (Comprehensive Transaction Platform, integrated trading platform) is a set of chairman system developed by the subsidiary of the previous period.

The secondary system is generally only used for issuing orders and withdrawing orders, paying attention to low delay penetration time, and is generally prepared for customers with higher delay requirements.

For the same order submitted at the same time, the second order will first arrive at the exchange for matchmaking. However, how to get to the exchange as quickly as possible is determined by many factors, and there is also a lot of knowledge in the test of penetration time. Later, I will share a series of studies on low-latency trading systems.

Counter systems generally provide API (Application Programming Interface, application programming interface) for programmed customers to access the counter. CTP API is a programming interface provided by the CTP system, which can be downloaded directly from the previous technical official website.

The official website only offers C++ version of API, while C++ has a steep learning curve, which is unfriendly for many beginners and is not suitable for getting started. I compiled the native Python version of CTP API, this series of articles will use the Python version of API to explain debugging, all the code is completely open source. If you reply "PyCTP" in the background, you can directly get the download link of Python version API, demo and instructions.

The interface functions and data structures of the Python version are exactly the same as those of the C++ version, and the usage is the same, so readers who use C++ can also use the C++ version of API directly according to the methods in this series.

II. Programmed login information

If customers need to call the API access counter for programmed transactions, they need some basic information when logging in, as follows:

1. BrokerID

For short, the futures quotient code refers to the futures company's code on the CTP system, which is four digits. For example, Haitong futures is 8000.

2. TradeFront, MarketFront

TradeFront refers to the pre-IP address of the transaction of the CTP system, which is used by customers to connect to place orders and withdraw orders, etc.; MarketFront refers to the pre-IP address of the market, which is used to subscribe to receive quotes.

3. InvestorID (UserID,InvestUnitID)

The investor code refers to the only ID of the client on the CTP system, which is assigned by the futures company after the futures company opens an account. UserID is the operator code and InvestUnitID is the investment unit code. Ordinary investors who want to fill in these two values can simply fill in InvestorID.

4.Password

The password set when opening an account. It should be noted that after opening an account and logging in to the CTP system for the first time, you need to change the password. Download the express client on the official website of the futures company and click to change the password.

5.AppID

Customer terminal software code.

6.AuthCode

Customer terminal software authentication code.

The above 1 and 2 are the same for all customers of the same system in a futures company. You can use the information of which futures company when you open an account. If you don't get it when you open an account, you can check the futures company page or consult customer service to get it. You can also reply "address" in the background to get the futures code and pre-address of the major futures companies in the market.

5 and 6 information is to tie in with penetrating regulation, how to get it, please refer to the previous article what is penetrating regulation and what do investors need to do? 3.2.1 chapter.

3. Simulation

There are two kinds of simulation system, one is provided by the futures company, this kind of backstage is basically connected to the corresponding exchange test environment, you can ask the futures company whether to provide

The other is the product simnow provided by the previous issue of technology. In this series of articles, we mainly use simnow testing. Referring to figure 1, the Magi Simnow simulation environment is mainly divided into two parts:

The first part is the CTP counter system, the same as the production environment. Customers can directly use the CTP API downloaded from the official website to test in simnow, and then seamlessly connect to the futures company's production environment.

The second part is the simulation exchange system, which is currently based on the simulation exchange developed by the previous phase of the system, not the real test environment of the five exchanges.

Simulating transactions on simnow also requires the login information mentioned in section 2 above (5 and 6 information is not needed for the time being, because simnow is not yet available on the penetrating version of the CTP counter).

1 and 2 are available from the products and Services page of the simnow home page. There are two sets of environments. Pay attention to the service time below. The first set is synchronized with the actual production and provides services only during the trading day.

3 and 4 can register an account from the upper right corner of the simnow home page, and you can receive SMS messages after successful registration.

Tip:

1. Registered mobile phone is not telecom mobile phone, because telecom mobile phone can not receive CAPTCHA.

two。 When filling in the account information, the counter selects "standard CTP".

3. The account password in the received text message is the InvestorID and Password of the login system. You need to change the password when you log in for the first time. You can choose to download "Express New Generation Trading system" on the common download page of the simnow home page, and change the password after installation.

4. After successful registration, you will get 1 million simulation funds. If you do not support the deposit after the loss of funds, you will have to change your mobile phone number and reapply for your account.

These are all the contents of this article entitled "what are the basic knowledge points of CTP programmed transactions?" Thank you for your reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report