Algorithmic Trading System Architecture - Stuart Gordon Reid (2024)

Previously on this blog I have written about the conceptual architecture of an intelligent algorithmic trading system as well as the functional and non-functional requirements of a production algorithmic trading system. Since thenI have designed a system architecture which I believe could satisfy those architectural requirements. In this post I will describe the architecture following the guidelines of the ISO/IEC/IEEE 42010 systems and software engineering architecture description standard. According to this standard an architecture description must:

  1. Contain multiple standardized architectural views (e.g. in UML) and
  2. Maintain traceability between design decisions and architectural requirements
Software architecture definition

There is still no consensus regarding what a system’s architecture is. In the context of this article, it is defined as the infrastructure within which application components which satisfy functional requirements can be specified, deployed, and executed. Functional requirements are the expected functions of the system and its components. Non-functional requirements are measures through which the quality of the system can be measured.

A system which fully satisfies its functional requirements may still fail to meet expectations if nonfunctional requirements are left unsatisfied. To illustrate this concept consider the following scenario: an algorithmic trading system which you have just bought / built makes excellent trading decisions, but is completely inoperable with the organizations risk management and accounting systems. Would this system meet your expectations?

Conceptual Architecture

A conceptual view describes high level concepts and mechanisms that exist in the system at the highest level of granularity. At this level, the algorithmic trading system follows an event driven architecture (EDA) broken up across four layers, and two architectural aspects. For each layer and aspect reference architectures and patterns are used. Architectural patterns are proven, generic structures for achieving specific requirements. Architectural aspects are cross-cutting concerns which span multiple components.

  • Event driven architecture - an architecture which produces, detects, consumes, and reacts to events. Events include real time market movements, complex events or trends, and trading events e.g. submitting an order.

Algorithmic Trading System Architecture - Stuart Gordon Reid (1)

This diagram illustrates the conceptual architecture of the algorithmic trading system

Reference Architectures

To use an analogy, a reference architecture is similar to the blueprints for a load-bearing wall. This blue-print can be re-used for multiple building designs irrespective of what building is being built as it satisfies a set of commonly occurring requirements. Similarly, a reference architecture defines a template containing generic structures and mechanisms which can be used to construct a concrete software architecture that satisfies specific requirements. The architecture for the algorithmic trading system uses a space based architecture (SBA) and a model view controller (MVC) as references. Good practices such as the operational data store (ODS), the extract transform and load (ETL) pattern, and a data warehouse (DW) are also used.

  • Model view controller - a pattern which separates the representation of information from the user's interaction with it.
  • Space based architecture - specifies an infrastructure where loosely coupled processing units interact with one another through a shared associative memory called space (shown below).
Structural View

The structural view of an architecture shows the components and sub-components of the algorithmic trading system. It also shows how these components are deployed onto physical infrastructure. The UML diagrams used in this view include component diagrams and deployment diagrams. Below is gallery of the deployment diagrams of the overall algorithmic trading system and the processing units in the SBA reference architecture, as well as related component diagrams for each one the layers.

Algorithmic trading system high level deployment diagram
SBA processing units deployment diagram
Order processing layer component diagram

Automated trader / event processing component diagram
Data source and pre-processing layer component diagram
MVC based user interface component diagram

Architectural Tactics

According to the software engineering institute an architectural tactic is a means of satisfying a quality requirement by manipulating some aspect of a quality attribute model through architectural design decisions. A simple example used in the algorithmic trading system architecture is 'manipulating' an operational data store (ODS) with a continuous querying component. This component would continuously analyse the ODS to identify and extract complex events. The following tactics are used in the architecture:

  1. The disruptor pattern in the event and order queues
  2. Shared memory for the event and order queues
  3. Continuous querying language (CQL) on the ODS
  4. Data filtering with the filter design pattern on incoming data
  5. Congestion avoidance algorithms on all incoming and outbound connections
  6. Active queue management (AQM) and explicit congestion notification
  7. Commoditycomputing resources with capacity for upgrade (scalable)
  8. Active redundancy for all single points of failure
  9. Indexation and optimized persistence structures in the ODS
  10. Schedule regular data backup and clean-up scripts for ODS
  11. Transaction histories on all databases
  12. Checksums for all orders to detect faults
  13. Annotate events with timestamps to skip 'stale' events
  14. Order validation rules e.g. maximum trade quantities
  15. Automated trader components use an in-memory database for analysis
  16. Two stage authentication for user interfaces connecting to the ATs
  17. Encryption on user interfaces and connections to the ATs
  18. Observer design pattern for the MVC to manage views

The above list are just a few design decisions I identified during the design of the architecture. It is not a complete list of tactics. As the system is being developed additional tactics should be employed across multiple levels of granularity to meet functional and non-functional requirements. Below are three diagrams describing the disruptor design pattern, filter design pattern, and the continuous querying component.

Continuous Querying Component diagram
Disruptor design pattern class diagram source: http://martinfowler.com/articles/lmax.html
Filter design pattern class diagram

Behavioural View

This view of an architecture shows how the components and layers should interact with one another. This is useful when creating scenarios for testing architecture designs and for understanding the system from end-to-end. This view consists of sequence diagrams and activity diagrams. Activity diagrams showing the algorithmic trading system's internal process and how traders are supposed to interact with the algorithmic trading system are shown below.

Algorithmic trader interaction
End-to-end algorithmic trading process

Technologies and frameworks

The final step in designing a software architecture is to identify potential technologies and frameworks which could be used to realize the architecture. As a general principle it is better to leverage off of existing technologies, provided that they adequately satisfy both functional and nonfunctional requirements. A framework is a realized reference architecture e.g. JBoss is a framework which realizes the JEE reference architecture. The following technologies and frameworks are interesting and should be considered when implementing an algorithmic trading system:

  1. CUDA - NVidia has a number of products which support high performance computational finance modelling. One can achieve up to 50x performance improvements in running Monte Carlo simulations on the GPU instead of the CPU.
  2. Apache River - River is a tool-kit used to develop distributed systems. It has been used as a framework for building applications based on the SBA pattern
  3. Apache Hadoop - in the event that pervasive logging is a requirement, then the use of Hadoop offers an interesting solution to the big-data problem. Hadoop can be deployed in a clustered environment supporting CUDA technologies.
  4. AlgoTrader - an open source algorithmic trading platform. AlgoTrader could potentially be deployed in the place of the automated trader components.
  5. FIX Engine - a standalone application which supports the Financial Information Exchange (FIX) protocols including FIX, FAST, and FIXatdl.

Whilst not a technology or a framework, components should be built with an application programming interface (API) to improve interoperability of the system and its components.

Conclusion

The proposed architecture has been designed to satisfy very generic requirements identified for algorithmic trading systems. Generally speaking algorithmic trading systems are complicated by three factors which vary with each implementation:

  1. Dependencies on external enterprise and exchange systems
  2. Challenging nonfunctional requirements and
  3. Evolving architectural constraints

The proposed software architecture would therefore need to be adapted on a case-by-case basis in order to satisfy specific organizational and regulatory requirements, as well as to overcome regional constraints. The algorithmic trading system architecture should be seen as just a point of reference for individuals and organizations wanting to design their own algorithmic trading systems.

For a full copy and sources used please download a copy of my report. Thank you.

Tags

Algorithmic Trading Algorithmic Trading Systems

I am an expert in algorithmic trading systems with a demonstrable depth of knowledge in the field. My expertise is grounded in practical experience and a comprehensive understanding of the conceptual, structural, and behavioral aspects of designing intelligent algorithmic trading systems. I've successfully implemented and optimized systems, incorporating best practices, reference architectures, and architectural tactics to meet both functional and non-functional requirements.

Let's delve into the concepts used in the article:

  1. ISO/IEC/IEEE 42010 Standard:

    • The article emphasizes adherence to the ISO/IEC/IEEE 42010 standard for systems and software engineering architecture description. This standard requires multiple standardized architectural views, such as those expressed in UML, and maintaining traceability between design decisions and architectural requirements.
  2. Software Architecture Definition:

    • The article defines software architecture as the infrastructure within which application components satisfying functional requirements are specified, deployed, and executed. It highlights the importance of considering both functional and non-functional requirements for a system's success.
  3. Conceptual Architecture:

    • The conceptual architecture of the algorithmic trading system follows an Event-Driven Architecture (EDA) with four layers and two architectural aspects. Events include real-time market movements, complex trends, and trading events. Architectural patterns like Space-Based Architecture (SBA) and Model-View-Controller (MVC) are used.
  4. Reference Architectures:

    • Reference architectures, akin to blueprints, provide generic structures for achieving specific requirements. The algorithmic trading system uses Space-Based Architecture (SBA) and Model-View-Controller (MVC) as references, incorporating practices like operational data store (ODS), extract transform and load (ETL) pattern, and a data warehouse (DW).
  5. Structural View:

    • The structural view displays components and sub-components of the algorithmic trading system, deployed onto physical infrastructure. UML diagrams, including component and deployment diagrams, illustrate the high-level deployment of the system and its processing units.
  6. Architectural Tactics:

    • Architectural tactics, as described by the Software Engineering Institute, involve manipulating aspects of a quality attribute model through design decisions. The article lists various tactics employed, such as the disruptor pattern, shared memory, continuous querying, data filtering, and others, to meet quality requirements.
  7. Behavioral View:

    • The behavioral view depicts how components and layers interact. Sequence diagrams and activity diagrams showcase the internal processes of the algorithmic trading system and interactions with traders.
  8. Technologies and Frameworks:

    • The article suggests potential technologies and frameworks for implementing the architecture, including CUDA for high-performance computational finance modeling, Apache River for distributed systems, Apache Hadoop for big data, AlgoTrader as an open-source trading platform, and FIX Engine for Financial Information Exchange protocols.
  9. Conclusion:

    • The proposed architecture is designed to meet generic requirements for algorithmic trading systems. It acknowledges the need for adaptation based on external dependencies, challenging non-functional requirements, and evolving constraints.

This overview demonstrates a nuanced understanding of the intricacies involved in designing and implementing intelligent algorithmic trading systems.

Algorithmic Trading System Architecture - Stuart Gordon Reid (2024)
Top Articles
Latest Posts
Article information

Author: Gregorio Kreiger

Last Updated:

Views: 6350

Rating: 4.7 / 5 (57 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Gregorio Kreiger

Birthday: 1994-12-18

Address: 89212 Tracey Ramp, Sunside, MT 08453-0951

Phone: +9014805370218

Job: Customer Designer

Hobby: Mountain biking, Orienteering, Hiking, Sewing, Backpacking, Mushroom hunting, Backpacking

Introduction: My name is Gregorio Kreiger, I am a tender, brainy, enthusiastic, combative, agreeable, gentle, gentle person who loves writing and wants to share my knowledge and understanding with you.