Asset Classes

Free investment financial education

Language

Multilingual content from IBKR

Close Navigation
Learn more about IBKR accounts
Automated Trading Systems: Architecture, Protocols, Types of Latency – Part I

Automated Trading Systems: Architecture, Protocols, Types of Latency – Part I

Posted September 17, 2024 at 11:50 am
Chainika Thakar
QuantInsti

The rise of automated trading has significantly transformed the structure of trading systems over the past decade and continues to do so. For firms, especially those involved in high-frequency trading, staying competitive in algorithmic trading now requires constant technological innovation.

In this post, we will break down the architecture behind automated trading systems, compare the new system designs with traditional ones, and explore the key components that make these systems work.

  • What is automated trading?
  • Difference between automated trading and algorithmic trading
  • Evolution of trading systems
  • What is the need for an automated trading system?
  • Automated trading architecture
  • Automated trading system protocols
  • Shift to the low latency architectures
  • Levels of sophistication in automated trading
  • How to build automated trading system?
  • Advantages of using automated trading systems
  • Disadvantages of using automated trading systems

What is automated trading?

An automated trading system (or fully automated trading) is a subset of algorithmic trading wherein computers are used to generate trading signals and manage the flow of orders in the markets without human intervention. ⁽¹⁾

Automated trading also includes quantitative modelling and risk monitoring.

Automated trading systems are used by an increasingly large percentage of market participants including trading firms, bankshedge funds, asset managers, and pension funds. They may develop their own systems or use systems provided by third parties. The degree of automation varies from system to system and other factors such as regulatory environment, stock exchanges, and cultural differences.

Recommended read:

What is Automated Trading?

Visit QuantInsti blog to watch the video on essential concepts of automated trading.

Moving to learning more about automated trading, let us now discuss how it is different from algorithmic trading.

Difference between automated trading and algorithmic trading

Below you can see the clear distinction between automated and algorithmic trading with each aspect mentioned.

AspectAlgorithmic TradingAutomated Trading
DefinitionTrading signals (buy/sell decisions) are generated based on a set of instructions in the form of algorithms. A subset of algorithmic trading where the generation of trading signals and placing of orders are automated via computers.
PurposeFocuses on reducing human error, saving time, and removing emotion from trading.Automates the entire trading process, from decision-making to execution without converting the instructions into algorithms using programming language.
Decision-MakingRelies on algorithms to determine how orders are executed.Includes automated decision-making for trading.

Recommended read:

Algorithmic Trading book

Next, we will check the evolution of trading systems over a period of time.

Evolution of trading systems

The traditional trading system was a mere interaction between the broker and the exchange for these three operations:

  • Receiving market data
  • Sending order requests
  • Receiving replies from the exchange

In order to buy or sell the stocks and securities, the trader had to approach a broker. This broker could be an individual or a firm. This broker used to be hired to trade on behalf of the trader who would do the buying and selling of financial instruments manually.

This traditional form of trading would be time-consuming and would involve making trading decisions based on emotions such as fear, greed, etc. Moreover, traditional trading lacked analytical accuracy since it was done manually. Going by the famous saying “to err is human”, the traditional or manual form of trading needed to be evolved.

With the advent of automated trading, the trading scenario changed or rather evolved into a more accurate, time-saving, and faster approach. In its basic form, we can portray the transfer of data from the exchange and the automated trading system as follows:

The market data, that is received, typically informs the automated trading system of the latest order book. It may also contain some additional information like the volume traded so far, the last traded price, and the quantity of the trading order.

However, to make a decision based on the data, the automated system looks at the old values or derives certain patterns from the history. Based on this historical analysis of data and patterns, the system goes forward to create a trading strategy and execute the same.

Last but not least, a GUI interface is needed for the trader to view all this information on a screen.

Next to discuss is the need for an automated trading system.

What is the need for an automated trading system?

The traditional architecture lacked the facilities that the automated trading system with Direct Market Access (DMA) provided. The latency between the receiving of market data to the order generation went beyond the dimension of human ability and entered the realms of milliseconds and microseconds with the automated trading system.

With time, it was realised that order management also needed to be more robust and capable of handling many more orders per second.

Since the time frame of order execution with algorithmic trading is less compared to manual order execution, risk management measures were also needed. For such practices as fast order execution and simultaneous risk management, an automated system was needed.

For example, even if the reaction time for an order is 1 millisecond, the system is still capable of making 1000 trading decisions in a single second. Thus, each of these 1000 trading decisions needs to go through risk management measures within the same second to avoid losses. You could say that when it comes to automated trading systems, this is just a problem of complexity.

Next to discuss is the automated trading architecture in which we will find out all about the working or the flow of automated trading.

Automated trading architecture

Taking all the points above into consideration, the traditional architecture of the entire automated trading system is broken down as follows –

  • The exchange(s) – the external world
  • The server
  • Receives market data
  • Stores the market data
  • Store orders generated by the user
  • Application
  • Takes inputs from the user initially for decisions such as stop loss, limits, the preferred financial instrument for trading etc.
  • Acts as an interface for viewing the information including the data and orders
  • Acts as an order manager sending orders to the exchange

Although the application layer is primarily a view, some of the risk checks can be offloaded to the application layer, especially those that have to do with the sanity of user inputs like fat finger errors.

The rest of the risk checks in automated trading systems are now performed by a separate Risk Management System (RMS) within the Order Manager (OM), just before releasing an order. The problem of scale also means that where earlier 100 different traders were managing their risk, there is now only one RMS system to manage risk across all logical units/strategies.

However, some risk checks may be particular to certain strategies, and some might need to be done across all strategies. Hence the RMS itself involves strategy-level RMS (SLRMS) and global RMS (GRMS). It might also involve a UI to view the SLRMS and GRMS.

Now let us understand the server components in more detail.

Market Adapter

Exchange or any market data vendor sends data in their own format. Your algorithmic trading system may or may not understand that language. Exchange provides you with an API or an Application Program Interface which allows you to program and create your own adapter which can convert the format of the data into a format that your system can understand. ⁽²

Complex Event Processing Engine

This part is the brain of your strategy. Once you have the data, you would need to work with it as per your strategy, which involves doing various statistical calculations, comparisons with historical data and decision-making for order generation. The type of order and order quantity are prepared in this block.

What do you call a trading system which is actually a CEP System?

A complex event is a set of other events that together imply an occurrence of something of significance. These include stock trends, market movements, news etc. Complex event processing is performing computational operations on complex events in a short time.

CEP systems process events in real-time, thus the faster the processing of events, the better a CEP system is. For example, if an automated trading system is designed to detect a good opportunity for the returns for the next 1 second, but the time taken by the CEP system exceeds this threshold, then the trading system won’t be able to make any good returns.

The CEP system comprises of four parts:

  • CEP engine
  • CEP rules
  • CEP WS
  • CEP result interface

The two primary components of any CEP system are the CEP engine and the set of CEP rules. The CEP engine processes incoming events based on CEP rules. These rules and the events that go as input to the CEP engine are mentioned in the trading system (trading strategy).

You can see in the image below where the CEP engine's role fits in the process of trade order generation starting from the application and reaching the exchange.

For a quant, the majority of his or her work is concentrated in this CEP system block. A quant will spend most of the time formulating trading strategies and performing rigorous backtesting, optimisation, and position-sizing among other things.

This is done to ensure the viability of the trading strategy in real markets. No single strategy can guarantee everlasting good returns. Hence, quants are required to come up with new strategies on a regular basis to maintain an edge in the markets.

There are a number of popular automated trading systems that are widely used in current markets. These are classified as different strategies namely momentum strategies, statistical arbitrage, market making, etc.

Let us see some protocols for automated trading systems.

Automated trading system protocols

Since the new architecture is capable of scaling many strategies per server, the need to connect to multiple destinations from a single server has emerged. So the order manager hosts several adapters to send orders to multiple destinations and receive data from multiple exchanges.

Each adaptor acts as an interpreter between the protocol that is understood by the exchange and the protocol of communication within the system. Multiple exchanges, thus, require multiple adapters.

However, to add a new exchange to the automated trading system, a new adapter has to be designed and plugged into the architecture. The need for a new adapter arises because each exchange follows its protocol that is optimised for the features that the exchange provides.

To avoid this hassle of adapter addition, standard protocols have been designed. The most prominent among them is the FIX trading protocol. This not only makes it manageable to connect to different destinations but also drastically reduces the go-to-market time when it comes to connecting with a new destination.

The presence of standard protocols makes it easy for the automated trading system to integrate with third-party vendors for analytics or market data feeds. As a result, the market becomes very efficient as integrating with a new destination/vendor is no more a constraint.

In addition, simulation becomes very easy as receiving data from the real market and sending orders to a simulator is just a matter of using the FIX protocol to connect to a simulator.

The simulator itself can be built in-house or procured from a third-party vendor. Similarly, recorded data can be replayed with the adaptors being agnostic as to whether the data is being received from the live market or from a recorded data set.

Originally posted on QuantInsti blog.

Join The Conversation

If you have a general question, it may already be covered in our FAQs. If you have an account-specific question or concern, please reach out to Client Services.

2 thoughts on “Automated Trading Systems: Architecture, Protocols, Types of Latency – Part I”

  • Too Slow

    Any idea of the latency for IBKR API orders?

    • Interactive Brokers

      Thank you for reaching out. IBKR is not able to determine the exact latency rate for API. However, an approximation for order acknowledgement latency is 75-130ms. This is described in our documentation here: https://www.interactivebrokers.com/download/salesPDFs/10-PDF0513.pdf. Please be aware that this does not factor in low speed internet connectivity, multi-layer API connectivity, or other unique network configurations. If you have any further questions, please create a web ticket for this inquiry; we have a category specifically for “API.” One of our API experts will be happy to guide you! http://spr.ly/IBKR_ClientServicesCampus

Leave a Reply

Disclosure: Interactive Brokers

Information posted on IBKR Campus that is provided by third-parties does NOT constitute a recommendation that you should contract for the services of that third party. Third-party participants who contribute to IBKR Campus are independent of Interactive Brokers and Interactive Brokers does not make any representations or warranties concerning the services offered, their past or future performance, or the accuracy of the information provided by the third party. Past performance is no guarantee of future results.

This material is from QuantInsti and is being posted with its permission. The views expressed in this material are solely those of the author and/or QuantInsti and Interactive Brokers is not endorsing or recommending any investment or trading discussed in the material. This material is not and should not be construed as an offer to buy or sell any security. It should not be construed as research or investment advice or a recommendation to buy, sell or hold any security or commodity. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.

IBKR Campus Newsletters

This website uses cookies to collect usage information in order to offer a better browsing experience. By browsing this site or by clicking on the "ACCEPT COOKIES" button you accept our Cookie Policy.