| High-frequency trading is a financial trading method that uses the computing advantage of computers to quickly detect small price differences of financial products in the market and arbitrage from them,which solves the problem of liquidity of large amounts of capital while also smoothing market prices and promoting market stability.At present,with the proliferation of high-frequency trading and the continuous innovation of trading strategies,it has gradually become a research hotspot in the global financial field.The major high-frequency trading systems in the market today are implemented based on FPGA(Field Programmable Gate Array)programmable logic devices,or the underlying programming language C++.These two implementations suffer from low R&D efficiency,expensive R&D costs,and security vulnerabilities that are not easy to find,which hinder the need for algorithm updates and rapid iteration of high-frequency trading.Therefore,this paper researches and designs a high-frequency trading system architecture based on high-level programming language,and meets the extreme requirements of latency,throughput and security for high-frequency trading system,in order to simplify the development threshold of high-frequency trading system and reduce the development cost.In the article,we do the following work:1)Based on the detailed analysis and study of high-level programming languages,the feasibility of developing a high-frequency trading system based on Java is clarified,and a memory database based on Mmap is proposed and designed to greatly reduce the data access latency,and a detailed quantitative analysis of the GC(Garbage Collector)mechanism affecting the latency is conducted,and an object pooling algorithm based on reuse technology is proposed to reduce the frequency and length of GC.The frequency and length of GC is reduced.It is verified that the average inprocess instruction penetration latency can be reduced by 5 ms using this algorithm.2)Based on the definition and analysis of throughput,a Reactor pattern and event-driven strategy is proposed to enhance the throughput of the highfrequency trading system by designing a flow-based uniform partitioning algorithm and a distributed ID generation strategy to solve the main two problems of the evolution of the high-frequency trading system from a single machine to a distributed architecture.Experiments verify that the network and thread-passing throughput meet the requirements of the high-frequency trading system.3)By introducing mature logging,monitoring,and task scheduling technologies,we have designed a common observable operation and maintenance strategy for high-frequency trading systems,which improves the robustness of highfrequency trading systems and reduces maintenance complexity.Finally,based on the above research,a set of design principles and common architecture of high-frequency trading system based on high-level language development is proposed to reduce the difficulty of high-frequency trading system development and promote the promotion of high-frequency trading system. |