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.
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).
Space-based architectural conceptual view
Model View Controller original image: http://goo.gl/TjJ28A

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

Algorithmic Trading System Architecture - Stuart Gordon Reid (2024)

FAQs

Who designed the trading algorithm? ›

One of the first algorithms used in financial markets was the “program trading” system developed by the New York Stock Exchange (NYSE) in the 1970s. This system allowed traders to enter a list of orders that would be automatically executed when certain market conditions were met.

Is algotrading profitable? ›

Yes, it is possible to make money with algorithmic trading.

What is the architecture of a trading bot? ›

An effective trading bot architecture encompasses: Data Collection: Setting up data sources and real-time data feeds. Strategy Implementation: Writing and testing the trading algorithm. Risk Management: Defining risk parameters, stop-losses, and profit targets.

Who first invented algorithm? ›

Al-Khwarizmi - The Genius Who. Invented Algebra. and the Algorithm.

What is the math behind algorithmic trading? ›

These are, at the very least, measures of central tendency and measures of dispersion. The first is commonly known as averages, and the most popular are the mean, median, and mode. The most widely used measures of dispersion are range, variance, standard deviation, and quantile deviation.

Is algorithmic trading illegal? ›

Yes, algo trading is legal. No rules are in place by any federal or financial regulatory body that prevent an individual from algo trading.

What programming language is used for algorithmic trading? ›

C++ C++ is favored by custom software development companies for building ultra-low latency algorithmic trading systems. Renowned for its speed and efficiency, C++ allows developers to optimize critical components of trading algorithms for maximum performance.

Which algorithm is best for trading? ›

Robo Trader

It is one of the most popular algo trading platforms owing to its user-friendly interface and the availability of extensive tools. The top features of Robo Trader include: Naked options trading strategy for automated identification and execution of options trading opportunities in underlying stocks.

Why does algo trading fail? ›

Inaccurate or Insufficient Data. While developing such AI-based models a huge amount of historical data is used to train the model through a machine learning algorithm. If data is not accurate the strategy will not work properly causing unexpected transactions or huge losses in the market.

Can I be a millionaire by trading? ›

In conclusion, while it is possible to become a millionaire through forex trading, it is not a guaranteed path to wealth. Achieving such financial success requires a combination of education, skills, strategies, dedication, and effective risk management.

How hard is algo trading? ›

While algorithmic trading offers numerous benefits, it also presents challenges: - Technical Complexity: Developing and maintaining algorithms requires strong programming skills. - Data Quality: The quality and accuracy of data used for trading are crucial.

Where did algorithmic trading come from? ›

The birth of algorithmic trading dates back to the 1970s when electronic communication networks (ECNs) and computer-driven trading systems were introduced. These innovations allowed traders to directly execute trades without the need for intermediaries like stockbrokers.

When was algorithmic trading invented? ›

Algorithmic trading emerged with the advent of the internet in the late 1980s and early 1990s. In the late 1980s and 1990s, financial markets transitioned to electronic execution and the development of electronic communication networks (ECNs).

Who invented chart patterns in trading? ›

The most famous candlestick trader is the man who invented them, Munehisa Homma. He was a Japanese rice trader who tracked price action and saw patterns developing. He published his work in The Fountain of Gold — The Three Monkey Record of Money in 1755.

Who gave his name to the concept of algorithm? ›

Al-Khwārizmī is famous for his mathematical works, which introduced Hindu-Arabic numerals and algebra to European mathematicians. In fact, the words algorithm and algebra come from his name and the title of one of his works, respectively.

Top Articles
Latest Posts
Article information

Author: Msgr. Benton Quitzon

Last Updated:

Views: 5640

Rating: 4.2 / 5 (63 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Msgr. Benton Quitzon

Birthday: 2001-08-13

Address: 96487 Kris Cliff, Teresiafurt, WI 95201

Phone: +9418513585781

Job: Senior Designer

Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.