openctp (Powered by TTS - Tick Trading System)
openctp is a platform based on the CTP ecosystem. It not only provides CTPAPI compatibility interfaces for counters such as Huaxin Securities Singularity, Zhongtai Securities XTP, Oriental Fortune EMT, Oriental Securities OST, and also provides a simulation environment similar to the previous technology SimNow simulation environment, and also supports CTPAPI interface. It not only provides simulated trading of futures and option varieties in various domestic futures exchanges, but also provides simulated trading of stocks, funds, bonds and stock options in A-shares, and also supports simulated trading of Hong Kong and US stocks.
openctp also provides the Python interface of CTPAPI and the Python interface of CTP stock options API. It opens the source of the CTP command line trading client ViTrader, and the graphical interface trading client TickTrader. The Mini version of MiniTrader supports openctp, CTP, CTP stock options, Zhongtai XTP, Huaxin Singularity Stock and Stock Options counters. MiniTrader uses the CTPAPI compatible interface technology of openctp and supports CTP, TTS, Huaxin Securities stock and stock options counters, without replacing the dll yourself.
openctp also provides a set of CTP services for websocket interface, webctp, which provides services to the outside world in the form of websocket+json, and also opens the source code.
openctp also provides development consulting and training for counter interfaces such as CTP, Huaxin Singularity, and Zhongtai XTP, as well as development training services for counter systems.

Directory structure:
- ctp2TTS: openctp simulates environment CTPAPI compatible interface.
- ctpopt2TTS: openctp simulates environment CTP stock options API compatible interface.
- ctp2CTPOPT: CTP Stock Options Counter CTPAPI compatible interface.
- ctp2XTP: Zhongtai Securities XTP counter CTPAPI compatible interface (including source code).
- ctp2STP: Huaxin Securities TORA Singularity Stock Counter CTPAPI compatible interface (including source code).
- ctp2EMT: Oriental Fortune EMT counter CTPAPI compatible interface (including source code).
- ctp2STPOPT: Huaxin Securities TORA Singularity Stock Options Counter CTPAPI compatible interface.
- ctp2OST: Oriental Securities OST counter CTPAPI compatible interface.
- ctp2YD: Yida counter CTPAPI compatible interface. (Officially provided by Yida)
- ctp2IB: Interactive Brokers TWS platform CTPAPI compatible interface.
- ctp2QDP: Quantitative QDP counter CTPAPI compatible interface.
- ctp2TAP: Yisheng TAP Qimingxing counter CTPAPI compatible interface.
- ctp2QQ: Tencent market CTPAPI compatible interface (including source code).
- ctp2Sina: Sina's CTPAPI compatible interface (including source code).
- demo: demo and tool source code related to CTPAPI development.
- tools: productivity tools.
- docs: Development documents and industry information.
- ctpapi-python: CTPAPI Python interface (official development of openctp).
- ctpapi-opt-python: The Python interface of the CTP stock options API (officially developed by openctp).
- ctpapi-java: Java interface of CTPAPI.
- ctpapi-go: Go interface of CTPAPI.
- ctpapi-c: C language interface of CTPAPI.
- ctpapi-rust: CTPAPI Rust language interface.
- ctpapi-csharp: C# language interface of CTPAPI.
- widgets: Graphic interface small application.
Openctp simulation environment
The openctp simulation environment is similar to the previous technology SimNow simulation environment. Both are testing and simulation platforms for the CTPAPI interface. CTP was developed in the last issue, and SimNow also uses CTP counters, so SimNow is the official test platform for the CTPAPI interface. Openctp has developed a counter system compatible with the CTPAPI interface. Since there are many CTP counter services, we openctp only considers it from the perspective of ordinary investors and only implements the interfaces that need to be used in general trading. The full version also needs to be tested at SimNow. In fact, SimNow is not very complete. After all, it is a simulation environment and many businesses do not support it, so some functions still need to be tested in the real-time environment.
There are three sets of openctp simulation environments, one set of 7x24 environments, which continuously play a period of market on the latest trading day, and the other set is a simulation environment, with the trading period consistent with the real market, which can be used to verify the operating effect of the strategy for a long time. In addition to futures, it also supports A-share stock trading. The third set is also a simulation environment, but the bandwidth is high and the varieties are provided. In addition to futures and options on futures exchanges, it also provides ETF options simulation transactions on the stock exchanges, and the fees are also very cheap. It only takes 300/year and ETF options varieties 500/year. Follow the openctp official account and reply to register VIP.
Supported varieties:
- Stocks, bonds, funds, stock options, etc. on the Shanghai and Shenzhen Stock Exchanges.
- All futures and option contracts for domestic futures exchanges such as the Shanghai Futures Exchange and China Securities Investment Corporation.
Advantages of relative SimNow:
- Provide 5 quotations
- Supports partial transactions and partial revocations.
- Negative price trading is supported (the contract number of negative price contracts is MINUS and is only available in 7x24 environments).
- Provide all commodities simulated transactions on each exchange.
- Follow the "openctp" official account and you will automatically get a 7x24 test account and simulation account. There is no need to provide privacy information such as mobile phone number. If you reply to "Register Simulation", you can register multiple simulation accounts. If you reply to "Register 24", you can register multiple 7x24 test accounts and take effect immediately.
- QQ group 564385877 answers questions and answers to questions related to CTP and transactions.
- Openctp's 7x24 environment is a real 7x24 environment, which is completely independent of the environment and has nothing to do with the simulation environment. The trading data such as positions and funds will not be reset.
- In addition to domestic futures and options, it also provides simulated transactions in global markets such as A-share stocks, bonds, funds, stock options, Hong Kong and US stocks, and foreign futures.
- Support market price orders and FAK/FOK orders.
- Supports CTP stock option interface and stock option contracts.
Matching method (supports market making and matchmaking at the same time):
- Matching: It is entirely matched by users, and the transaction is matched based on price and time. There are only three contracts in the matchmaking mode, with the contract codes being TEST, BTC, and MINUS, and the other contracts are all market-making modes.
- Market making: Simnow uses the market making model, and trades in real market conditions, that is, long orders above the hawking price will be traded immediately, and short orders below the be traded immediately, otherwise they will be traded when the market meets the conditions in the middle of the queue.
Partial transactions, partial cancellations:
- The market making model in the simulated environment will not be partially traded. To test some transactions, you can trade three contracts: TEST, BTC, and MINUS in the 7x24 environment.
Openctp simulated environment account registration
Follow the openctp official account, reply to the corresponding information and register a demo account, which will take effect immediately, with an initial fund of 10 million.
- Register for 7x24 environment account, reply to register 24, register an additional 7x24 account for each reply, and register up to 3 numbers per WeChat.
- Register for simulation environment account, reply to register for simulation, register one more simulation account for each reply, and register up to 3 numbers per WeChat.
- Register a vip environment account, reply to register a vip, register one more vip account for each reply, and register a maximum of 3 numbers per WeChat.
BrokerID, AppID, AuthCode
The openctp simulation environment does not check these fields, and all three items can be filled in.
7x24 simulation environment
Transaction pre-tcp://121.37.80.177:20002, or use the domain name tcp://openctp.cn:20002
Market pre-tcp://121.37.80.177:20004, or use the domain name tcp://openctp.cn:20004
Simulation environment
VIP simulation environment
openctp monitoring platform
openctp provides a monitoring platform that centrally monitors simulated environments such as SimNow, Huaxin N Vision, Zhongtai XTP, and Dongcai EMT. Of course, it also includes openctp's own simulated environment. There are several environments and whether it is open can be seen at a glance. Click here to see: CTP interface simulated environment monitoring.
openctp also provides monitoring of the CTP counter real-time environment of dozens of mainstream futures companies, and marks futures companies that provide free 5-level market support for the Shanghai Futures Exchange. Click here to see: CTP counter real-time environment monitoring.

Download CTPAPI and CTPAPI compatible interfaces for each counter:
Download CTP, TTS, XTP, TORA and other counter interfaces
TickTradingFramework strategy trading framework
There are many pitfalls in the CTPAPI interface, which is very professional, and it is difficult to deal with real-time calculation of positions and funds. The freezing and calculation of various positions and funds fields, etc. Openctp provides a lightweight Tick-based CTPAPI strategy trading framework source code, maintaining the original CTP data structure, the code is very beautiful, less than 5,000 lines, it is simple and easy to understand, and secondary development is easy. For more introduction, see: CTPAPI strategy trading framework.
- The source code of the CTP strategy trading framework Python-Lite version (calculated without handling fees and margins), 5,000 yuan.
- The source code of the CTP strategy trading framework Python version, 10,000 yuan. Only support order accounts, and real-time calculation of positions and funds.
- CTP strategy trading framework Python multi-account version source code, 20,000 yuan. It supports multiple accounts and can access counters such as Huaxin Securities, Zhongtai Securities through the CTPAPI compatible interface of openctp.
- CTP strategy trading framework C++ version source code, 20,000 yuan. Only support order accounts, and real-time calculation of positions and funds.
- CTP strategy trading framework C++ multi-account version source code, 30,000 yuan. It supports multiple accounts and can access counters such as Huaxin Securities, Zhongtai Securities through the CTPAPI compatible interface of openctp.
- CTP strategy trading framework C++ multi-counter multi-account version source code, 40,000 yuan. Support multiple accounts, support cross-counter strategy transactions such as Huaxin Securities, Zhongtai Securities, Yisheng, etc., support multiple data sources such as Huaxin Securities, Zhongtai Securities, Yisheng, and support load balancing between data sources.
openctp training service
Openctp provides technical training in securities and futures trading development, and also provides industry-independent basic technical training. Openctp's training tends to be employment-oriented. For example, if you want to go to a private equity or technology company to engage in quantitative or counter system development, of course, it is also OK if you want to learn some technology yourself to help you do better trading. Openctp's training is iterative and will be updated continuously to supplement more content. Students can communicate permanently within the corresponding course groups. Each course in all courses has a trial video on Bilibili. You only need to reply to the two words training on the official account of Openctp to get the contact information.
Openctp organizes students to conduct technical exchanges from time to time to create a good learning atmosphere for everyone.
Course Introduction
- The first issue: C/C++ advanced programming, 5,000 yuan, based on the Think library of the C language cross-platform development framework developed by krenx, including socket network programming, IPC process communication, etc., there are many practical tools that can be applied to work immediately. In addition, there are explanations of development technologies such as boost.asio asynchronous network communication framework, and corresponding example source codes are also provided.
- The second issue: CTP, XTP and other counter interface development technologies, 5,000 yuan, explained based on openctp-related technologies, including CTPAPI underlying logic, various precautions for CTPAPI, and textTrader source code explanation of open source CTP client, etc.
- The third phase: trading system development, 8,000 yuan, explained based on the TTS trading system, including trading system structure, architecture technology, business table structure design, key business processing, etc.
- Issue 4: Financial trading business and product design, 5,000 yuan, talk about the development history of global stocks, futures and options trading, trading rules, calculation formulas, risk control and product design, and provide a detailed description of all commonly used fields of CTP.
- Issue 5: In-memory database architecture transaction system bus development technology, 10,000 yuan, explains bus development technology like CTP through TTS's bus architecture technology, including repetition, hot standby, load balancing, shortest routing, distributed computing and other technologies. In-memory computing architecture can be used in high-performance communications in various industries, far more than the financial transaction field.
Openctp Open Class
Openctp has done some free 0 basic learning courses to help more friends enter the software programming and securities and futures trading industries.
- C language open course: Talking about basic programming technology in C language in a vivid and interesting way, focusing on cultivating interest and building confidence.
- C++ language open course: Tell the basic programming technology of C++ language in a vivid and interesting way, and the course is being prepared.
- Linux environment programming open course: introduces the past and present of Unix&Linux, talks about the use of shell, VI editor, etc., the use of network tools such as netstat, traceroute, ifconfig, lsof, etc., regular expressions, etc., and everyone can understand 0 basics.
Real trading
Openctp has cooperative securities companies and futures companies. Not only does it have low transaction fees, but it can also receive free technical support services (CTP, XTP and other interfaces and application development training, etc.). For details, please follow the openctp official account and reply to the word "consultation".
Products that have officially supported openctp-TTS system:
TickTrader (a trading client developed by openctp, supports orders based on price, supports global market trading, supports CTP, CTP stock options, TTS, Huaxin Securities stocks and stock options and other counters) 
MiniTrader (the CTP trading client developed by openctp supports orders at the price, supports CTP, TTS, Huaxin Securities Stock and Stock Options, Zhongtai XTP, Dongcai EMT, Yisheng TAP, Yida, Quantou QDP and other counters)

vn.py (famous Python quantitative trading client, supports global market trading)

MT5CTP (MT5 software, which supports domestic A-share, futures and options trading, QQ group: 967352413, note openctp.)

ViTrader (CTP open source command line trading terminal, supports A-share, futures and options trading)

WonderTrader (a high-efficiency and highly available quantitative transaction development framework based on C++ core modules, adapted to all markets and all varieties of transactions, QQ group: 610730738, note openctp.)

ctpbee (a lightweight Python quantitative transaction framework that supports CTP counters.)

Technical communication
QQ group: 564385877
openctp official website
www.openctp.cn
openctp official account

Featured articles:
- How to use the capabilities provided by the CTP open platform
- CTP interface development "Sunflower Book"
- CTP interface supports pip install
- Summary of quantitative transaction data of CTP interface
- Open Tencent Market CTPAPI Interface Source Code
- Open Sina Market CTPAPI Interface Source Code
- CTP program seamlessly connects to Huaxin Securities Singularity Counter (CTP2STP)
- Release Huaxin Securities Singularity Counter Stock Options CTPAPI
- Open Huaxin Securities Singularity Counter Quotation CTPAPI Interface Source Code
- Release a batch of market display tools (command line version)
- Openctp training and consulting services
Note: Openctp does not make any guarantees for simulated transactions and related services, and the consequences of using openctp products for real-time transactions are entirely borne by the user.