📜 ⬆️ ⬇️

Description of the process of creating an online trading system architecture: hedge fund analyst approach



We write a lot about the creation of trading systems and create tools for their development (from the brokerage system API to the designer of robots inside the trading terminal ). Today we will discuss the design of the architecture of the alaorhimic trading system - the material from the Turing Finance blog, written by NMRQL hedge fund analyst Stuart Reed, is devoted to this topic.

In his article, the author describes the principles of creating an architecture for a trading system that would meet the requirements of ISO / IEC / IEEE 42010 and standards for describing software of engineering architectural systems. According to these standards, the description of the architecture should contain various standardized architectural approaches and support links between design solutions and system requirements. We present to your attention an adapted translation of this article.
')

Choosing software


Disputes about the fact that there is a system architecture, are still ongoing. In the context of the topic of the article, the author proposes to understand by this the internal infrastructure, the application components of which satisfy the functional requirements, can be installed, deployed and launched. Non-functional requirements can be assessed through the quality of the system itself.

Even if all the functional requirements are met, this does not mean that the system is built with high quality. Non-functional requirements should also be taken into account. We illustrate this idea with an example. Imagine the following picture: the trading system that you have just acquired or independently built is making the right trading decisions. But it is arranged in such a way that neither risk management organization nor accounting reports can be entrusted to it. It is unlikely that such a system can be called fully satisfying.

Architecture concept


At the abstract level, the concepts and basic mechanisms of the system are described. It is desirable with deep and detailed study. At this stage, the trading system is “packaged” into the Event Driver Architecture. That, in turn, is divided into 4 layers and two separate approaches. For each of them their own references and patterns are used. Patterns are generally accepted structures for achieving specific objectives.

An event management architecture is an architecture that allows you to detect, produce, and destroy events or respond to them. Events can be: real-time market movements, complex events or trends, trading signals that are streamlined in one way or another.

The concept of the trading system architecture is shown in the picture:

image

Reference Architecture


If you use the construction metaphor, then the reference architecture is the same as the design of the bearing wall. It can be used to create rooms of various designs. The main thing - it satisfies the basic requirements of building standards. The reference architecture is a kind of model that describes the general structures and mechanisms that are fashionable to use to create a specific architectural software with specific requirements.

The architecture for an algorithmic trading system uses the spatial architecture (SBA) and the fundamental model-view-controller (MVC) pattern as references. Practices such as the operational data warehouse (ODS), the “extract, transform, load” pattern (ETL) and the corporate data warehouse (Data Warehouse) are also suitable.





Model view controller

image

Spatial architecture

Structural approach


At the construction stage, the components and sub-components of the trading system are determined. The framework defines how these components will be deployed within the physical infrastructure. A UML diagram (a diagram in a unified modeling language) shows which components are included and how they are deployed. The figures show deployment diagrams: common and for each of the layers.











Architectural Tactics


Tactics deals with the qualitative attributes of a model. The simplest example of how the system tries to adapt to quality requirements is the manipulation of an operational data set through continuous queries. These components are able to continuously analyze ODS to detect and extract complex events. Here is a list of tactics that are used in architecture:

  1. Disintegrator pattern in the event queue.
  2. Allocated memory for the queue and event order.
  3. Continuous Query Language (CQL) for ODS.
  4. Data filter for incoming information.
  5. Algorithms for the distribution of incoming and export connections to bypass congestion.
  6. Active Queue Management (AQM) and congestion notification system.
  7. Calculation of resources consumed with the ability to scale the system.
  8. Active redundancy for every single fault.
  9. Indexing and optimization of resilient structures in ODS.
  10. Schedule regular backups and cleanup scripts for ODS.
  11. Transaction history to all databases.
  12. Checksums for each row for error detection.
  13. Annotation of events with time stamps for ignoring obsolete events.
  14. Establish order confirmation rules for the maximum number of trading events.
  15. Automated trading components use memory-based databases for analysis.
  16. Two-level authentication in the user interface to activate the connection.
  17. Encryption in the user interface to connect.
  18. Observation pattern for managing MVC views.

This list offers only a small number of design solutions that the author of the article was able to identify during the development of the architecture for the trading system. The list is far from complete. At each level of detail, new tactics are added to meet the functional and non-functional requirements. The picture shows three diagrams describing the disintegrator pattern, filter pattern, and continuous query components:







"Behavioral" view


This architecture overview demonstrates how the components and layers of the system should interact. It is very useful when you develop scripts to test the system and understand how everything works from beginning to end. This review consists of sequence diagrams and activity diagrams. The latter show the internal processes of the trading system and how the traders themselves interact with it. Examples of such diagrams are presented below.





Techniques and frameworks


The final step in developing the architecture of the software part of the trading system is to find suitable techniques and frameworks that can be used to implement it. The general rule here is: try to squeeze everything out of the existing techniques for a start, making sure that they meet functional and non-functional requirements. The framework in this case is a reference architecture. For example, the JBoss framework implements the JEE reference architecture. Here is a list of several techniques and frameworks that can be used to create a trading system architecture:


It should be remembered that any components (techniques or frameworks) must have an API to ensure their compatibility.

Conclusion


The proposed version of the architecture satisfies the most general requirements of algorithmic trading systems. For such systems, three factors bear the main load, which act in practice in different combinations:


The proposed architecture needs to be adapted based on movement from case to case. It must meet specific organizational, regulatory requirements and regional restrictions. Simply put, the article presented only a list of useful links that still need to be customized for individual needs.

Other materials on the topic from ITinvest :


Source: https://habr.com/ru/post/302990/


All Articles