Anatomy of an automated trading system

Automated trading systems are complex systems, with many building blocks, which all interact with each other. This post is taking a closer look at these building blocks.

Data Source

 

The trading system requires quotes for the stocks it is following and/ or trading. There are 2 categories of data sources: historical data, as used for back-testing and reaching back several years, and real-time data, providing a live stream of quotes will the exchanges are in session. Real-time data are most often provided through the broker. While brokers also provide historical data, these often don’t reach back far enough to support algorithm development. Therefore, packages with historical data reaching back 10 or more years are often purchased from specialized data providers instead.

Broker

In order for the orders to be executed, the trading system submits them to a broker, which will then forward these to the exchange, and manage the account. Typically the broker acts as the custodian for the funds traded. Also, the broker might provide special account types to allow trading multiple accounts simultaneously, and using pre-defined allocation schemes to allocate the traded shares to the individual accounts. Commonly used brokers include Interactive Brokers, CQG, Rithmic and many more, often specialized on certain asset classes, markets, or locations.

Trading Framework

The trading framework provides all the infrastructure that is commonly used by automated trading systems, including the connections to data sources and brokers, and the calculation of indicators and signals. The trading framework is typically not only the platform that an automated trading system runs on, but also the tool used for research and development of algorithms and strategies. In this capacity, the trading framework simulates trades based on historical data, so called back-testing, and allows to analyze the algorithm’s behavior, most importantly risk and performance. Commonly used frameworks include MultiCharts, NinjaTrader, QuantConnect and Quantopian.

 

Trading Application

This the ‘secret sauce’ of the trading system, containing all the proprietary code to identify opportunities, calculate risks, and make trading decisions. In addition, the application also contains the definition of list of instruments to follow or trade (the so-called universe), and information about all the connections to other building blocks.

The trading application is typically written in a high-level computer language, e.g. C#, C++, Python, or similar, making use of commercial frameworks to reduce development complexity, and allowing developers to focus on research of algorithms.

At the core of the trading application is an algorithm. The building blocks of trading algorithms are described in a future post.