Systematic trading

Getting started building a fully automated trading system

Systematic trading · Published 2026-10-20

A technician kneeling with a laptop beside an open server rack in a data centre
A technician at work on a server rack at the NERSC data centre in Berkeley. Photo: Derrick Coetzee, CC0.

A backtest is a story about the past. An automated trading system is a machine that acts in the present, unattended, with real money. The gap between the two is mostly engineering: getting data reliably, turning signals into orders, controlling risk before every trade, and noticing quickly when something breaks. This article describes the components of a fully automated system and the decisions involved in building one.

Educational content. Automated trading can lose money quickly through errors as well as through market moves. Nothing here is advice to trade.

Semi-automated versus fully automated

Many traders begin semi-automated: a program computes signals and target positions, and a person reviews them and places the orders, perhaps by uploading a list to a broker's platform. This is slower, but a human checks every order before it reaches the market. Ernest Chan's books on quantitative trading recommend this route for independent traders starting out, because it separates research mistakes from execution mistakes.

A fully automated system runs the whole cycle without human intervention: it receives data, computes signals, generates orders, sends them to a broker, receives fills and updates its positions. Automation removes manual errors and emotional interference and makes higher trading frequencies possible. It also means that a bug can place thousands of orders before anyone notices.

The components

1. Market data

The system needs prices, and possibly volumes, order book data, fundamentals or news, delivered on time and in a consistent format. Data handling includes adjusting for corporate actions, filtering bad ticks, and detecting stale or missing data. A signal computed on a frozen price feed is one of the most common sources of bad trades.

2. Signal generation

This is the strategy logic validated in research. In production, it must produce exactly the same output as the research code given the same inputs. Sharing a single code base between research and production, or testing the production code against stored research results, prevents silent divergence.

3. Portfolio and risk logic

Signals become target positions after sizing rules, constraints and risk limits are applied: maximum position size, sector or asset-class limits, gross and net exposure, and leverage. Our article on choosing your risk discusses sizing methods. Risk checks should run before every order is sent, not only at the end of the day.

4. Order management

The order management system (OMS) checks target positions against current holdings, generates the necessary orders, chooses order types (market, limit, stop) and tracks each order's state from submission to fill or cancellation. For larger orders, execution algorithms split trades over time to reduce market impact.

5. Broker connectivity

Retail and professional brokers offer application programming interfaces (APIs) for submitting orders and receiving fills. Institutional systems commonly use the FIX protocol, an open messaging standard for securities transactions maintained by the FIX Trading Community. Connectivity code must handle disconnections, rejections, partial fills and duplicate messages.

6. Position and accounting records

The system keeps its own record of positions and cash and reconciles it with the broker's statements. Discrepancies, from missed fills, corporate actions or fees, must be detected and resolved before the next trading cycle.

7. Monitoring, logging and kill switches

Every decision should be logged with its inputs. Monitoring should alert a person when something unusual happens: no data for a period, orders rejected, positions diverging from targets, losses beyond a threshold. A kill switch, a way to cancel all open orders and stop new ones immediately, is essential.

A cautionary case

On 1 August 2012, Knight Capital, then one of the largest U.S. equity market makers, deployed new software to its order routing system. One of its eight servers did not receive the update and began executing old, dormant code. In about 45 minutes it sent millions of orders into the market. According to the U.S. Securities and Exchange Commission's 2013 order, the firm lost more than 460 million dollars. The SEC found failures in deployment procedures, in controls on order flow and in responses to automated alerts. The case is a standard lesson in why deployment checks, pre-trade limits and kill switches matter at every scale.

Regulatory controls

Regulators require brokers and trading firms to control automated order flow. In the United States, the SEC's Market Access Rule (Rule 15c3-5, adopted in 2010) requires broker-dealers with market access to have pre-trade risk controls, such as credit and capital thresholds and checks for erroneous orders. In the European Union, MiFID II and its regulatory technical standards on algorithmic trading require firms using algorithms to test them, set limits and maintain kill functionality. Independent traders using a broker's API are subject to the broker's own controls, which can reject orders that breach limits.

A sensible path

  1. Validate the strategy in research with realistic costs, as in our strategy creation guide.
  2. Run it semi-automated, reviewing every order, until the signal and sizing code are trusted.
  3. Connect to a broker's paper trading environment and automate order submission there.
  4. Add monitoring, alerts, reconciliation and a kill switch before going live.
  5. Go live with small size, check live fills against the simulation, and scale only gradually.

Choosing tools

Python is the most common language for independent and research-oriented systems, with libraries for data handling and broker APIs; lower-latency systems use C++, Java or specialised hardware. Open-source event-driven frameworks can serve as a skeleton for both backtesting and live trading. Our guide to open source for quantitative finance surveys the options, and inside the black box describes how professional systems divide the work between alpha, risk, cost and execution models.

Sources