Algorithmic trading risk controls are the automated limits and procedures that sit between a strategy and the market: pre-trade checks that reject a bad order before it is sent, intraday limits on positions and losses, a kill switch that stops everything, and post-trade reconciliation that confirms what actually happened. They exist because software can repeat a mistake thousands of times before a person notices it.
This guide is part of our Algorithmic Trading Technology guide. It is written for trading desks, funds and other institutional teams that run, or are about to run, automated strategies. It covers controls, process and technology only. It does not tell you what to trade or how much risk to take.
What are risk controls in algorithmic trading?
A risk control is a rule that is enforced automatically and independently of the strategy that generates orders. The independence is the point. A strategy decides what it wants to do. A control decides whether it is allowed to.
Controls are usually grouped by the moment at which they act:
- Pre-trade controls check every order before it leaves your system and reject the ones that break a limit.
- Intraday controls watch the running totals: positions, exposure, losses, order counts and message rates.
- Emergency controls stop trading altogether: the kill switch and cancel-on-disconnect.
- Post-trade controls compare what your system believes happened with what the broker or exchange reports.
Risk controls are not the same thing as the risk management inside a strategy. A stop-loss rule, a position-sizing formula or a volatility filter is part of the trading logic. It can be wrong in the same way the rest of the logic can be wrong. Controls are the layer that still works when the strategy does not.
Why do automated strategies need controls that sit outside the strategy?
There are three reasons, and each one comes from how software fails.
Software fails fast and repeats itself. A person who enters a wrong order makes one mistake. A program with a wrong parameter makes the same mistake on every signal until something stops it.
The failure is often not in the strategy. It is in the deployment, the configuration, the data feed, the reconnect logic or an old piece of code that was never removed. A limit coded inside the strategy does nothing about a fault in the order router beneath it.
Alerts without authority do not stop anything. If the only response to a problem is an email, the control depends on somebody reading it in time.
The best documented example is public. On 1 August 2012 an order router at Knight Capital sent more than 4 million orders into the market within the first 45 minutes of trading while it tried to fill 212 customer orders. The firm lost more than $460 million. The US Securities and Exchange Commission later charged the firm under its market access rule and the firm agreed to pay a $12 million penalty. The SEC’s findings read like an inverted checklist: no adequate controls at the point immediately before orders reached the market, financial risk controls that could not stop orders above pre-set capital thresholds, inadequate controls over code deployment and testing, and insufficient written procedures for responding to incidents. An internal system had generated 97 automated emails about the error before the market opened, and nobody acted on them. The details are in the SEC press release of 16 October 2013.
Where should risk controls sit: strategy, platform, broker or exchange?
The short answer is: in more than one place, and never only inside the strategy.
The Futures Industry Association, in its July 2024 paper Best Practices for Automated Trading Risk Controls and System Safeguards, describes controls that can be implemented at several points in the order flow: at the trader, at the broker or at the exchange itself. Each level protects against a different failure.
| Level | What it is good at | What it cannot do |
|---|---|---|
| Inside the strategy | Trading rules such as stops and sizing | Protect against its own bugs or wrong parameters |
| Trading platform or order gateway | Hard limits applied to every order from every strategy, firm-wide totals, the kill switch | Act if the platform itself is down or disconnected |
| Broker | Account-level limits that apply even if your own systems fail | Understand the intent of an individual strategy |
| Exchange | A baseline for every participant: price bands, message limits, cancel-on-disconnect | Reflect your firm’s own risk appetite |
Three practical rules follow from the table.
- Put your own hard limits in the platform or gateway, not in strategy code. A limit that a strategy developer can change by editing the strategy is a preference, not a control.
- Do not outsource your limits to the broker. Broker and exchange limits are set to protect them and the market. They are normally far wider than the limits your own risk policy would set.
- Know which controls only you can run. The FIA paper notes, for example, that limits on repeated automated executions should be set by the automated trader, not by the broker or the exchange, because only the trader knows what normal behaviour looks like for that strategy.
Which pre-trade risk controls should every algorithmic strategy have?
Pre-trade controls check each order against fixed limits before it is sent. If the order breaks a limit it is rejected and logged, and an alert is raised. The checklist below covers the controls that appear in both the FIA paper and the European rules for algorithmic trading firms (Commission Delegated Regulation (EU) 2017/589, Article 15, which names price collars, maximum order values, maximum order volumes and maximum message limits).
- Maximum order size. A cap on the quantity of a single order, per instrument. This is the classic “fat finger” limit. Set it from the strategy’s normal order size, not from the account size.
- Maximum order value. A cap on the notional value of a single order. Quantity limits alone do not work across instruments with very different prices or contract sizes.
- Price tolerance, or price collar. An order with a limit price too far from a reference price (last trade, mid or previous close) is rejected. Decide the reference price and what happens when the reference itself is stale.
- Market data reasonability. Before the strategy acts on a price, the system checks that the price is plausible: not zero, not negative where that is impossible, not a jump that far exceeds recent ranges, and not older than a set age.
- Message throttle. A cap on orders, modifications and cancels per second. One rule from the FIA paper deserves a line of its own: a throttle should never reject a cancel request because of a rate limit. You must always be able to get out.
- Repeated execution limit. After a set number of repeated fills or identical orders in a short window, the strategy is disabled until an authorised person switches it back on. This is the control that catches a loop.
- Duplicate order check. The system recognises an order it has already sent, especially after a reconnect or restart, when duplicates are most likely.
- Self-match prevention. Where several strategies trade the same instrument, the system or the exchange prevents them from trading with each other.
- Permitted instruments and sessions. Each strategy has a list of instruments it may trade and the hours in which it may trade them. Anything outside the list is rejected.
Two tests show whether a pre-trade control is real. First, can you point to the log line of the last order it rejected? Second, does it apply to manual orders and test orders sent through the same connection? A limit with an exemption for “just this once” is where incidents start.
Which intraday limits stop a small fault becoming a large loss?
A single order can pass every pre-trade check and still be the two-hundredth order of a bad morning. Intraday limits look at the running totals.
- Maximum position per instrument, long and short, counting working orders as well as filled ones. An unfilled order is a position you have already agreed to take.
- Maximum gross and net exposure per strategy, per asset class and for the firm.
- Daily loss limit per strategy. At the limit, the strategy stops opening new positions and a person reviews it. Decide in advance whether existing positions are held, reduced or closed, and who makes that call.
- Firm-wide daily loss limit. Strategies that each stay inside their own limit can still add up to an unacceptable day.
- Cumulative loss limit. A limit measured from a high point over weeks rather than hours, at which the strategy is paused for a formal review.
- Order and trade count limits. A strategy that normally trades thirty times a day and has traded three hundred times by mid-morning is telling you something, whatever its profit and loss says.
- Capital and margin thresholds. The system knows how much capital and margin is available and blocks orders that would exceed a set share of it.
Use two levels for each limit: a soft level that raises an alert and a hard level that blocks. The soft level gives a person time to look. The hard level does not depend on anyone looking.
Set the numbers before the strategy goes live, when nobody is under pressure, and record why each number was chosen. Our algorithmic trading go-live checklist puts limit setting at stage five of seven for that reason.
What should a kill switch do, and who should be able to use it?
A kill switch is the control of last resort. In the FIA’s wording it immediately disables all trading activity for a participant and cancels working orders. The European rules require a comparable “kill functionality” (Article 12 of Regulation 2017/589): the ability to cancel unexecuted orders immediately as an emergency measure.
A kill switch that works under stress has these properties:
- Scope is selectable. One strategy, one account, one market, or everything. Stopping the whole firm because one strategy misbehaves creates its own risk.
- It does two things. It blocks new orders and it cancels working orders. Blocking alone leaves resting orders in the market.
- It does not flatten positions automatically, unless you have decided that it should. Stopping a strategy and closing its positions are separate decisions. Closing in a hurry can cost more than the original fault.
- It sits outside the strategy and outside the strategy’s process. If the strategy has hung, a kill command sent to the strategy will not arrive.
- More than one named person can use it, and at least one of them is available at all times while the strategy runs. Nobody needs permission to press it.
- Using it is logged, and re-enabling requires a second person.
- It is tested on a schedule, in production conditions with a small live or paper strategy, not only in a test environment.
Cancel-on-disconnect belongs in the same family. If your session with the broker or exchange drops, resting orders are cancelled automatically at the other end. Check whether your venue or broker offers it, whether it is switched on for your session, and what happens to orders that you want to stay in the market, such as protective stops.
What post-trade checks and monitoring catch what pre-trade controls miss?
Pre-trade controls act on what your system intends to do. Post-trade controls act on what really happened. The two can differ: fills arrive late, a message is lost, a restart leaves the system with the wrong picture of its own positions.
- Drop copy reconciliation. A drop copy is an independent feed of your executions from the broker or exchange. Compare it with your own records continuously or as near to real time as the feed allows. A break means your system’s view of its positions is wrong, and every limit that relies on that view is wrong too.
- Position reconciliation against the broker’s records at least daily, with breaks investigated the same day.
- Heartbeats for the data feed, the broker connection and each strategy process, with an alert when one stops.
- Behaviour alerts. Trade count, turnover, fill rate, slippage or rejection rate outside the range seen in testing. A sudden rise in rejected orders is often the first visible sign of a fault.
- Complete, timestamped logs of every signal, order, modification, cancel, fill, rejection, limit breach and manual intervention.
Speed matters here. For firms under the European rules, Article 16 of Regulation 2017/589 states that real-time alerts must be generated within five seconds of the relevant event. Whether or not that rule applies to you, it is a useful benchmark: an alert that arrives minutes later describes history.
Each alert needs an owner and a written first action. An alert that goes to a shared mailbox, with no named person responsible for reading it, repeats the weakness described in the Knight Capital findings.
Who should own, change and test the risk limits?
Controls fail more often through governance than through code. A limit is raised “for today” and never lowered. A new strategy is copied from an old one and inherits limits that do not fit it. A test order bypasses the gateway. The checklist for governance is short.
- Separate the roles. The person who builds or runs a strategy does not set or change its limits. In a small team, where full separation is not possible, a second person approves every change.
- Keep a limits register. One document or screen lists every limit for every strategy, its current value, who approved it, when, and why.
- Control changes. Limit changes and code changes go through the same steps: request, approval, record, and a check afterwards that the new value is the one actually running.
- Make temporary changes expire. A limit raised for a specific event returns to its normal value automatically.
- Control deployment. New code and new configuration are tested, released by a second person, and can be rolled back. Old code that is no longer used is removed.
- Test the controls themselves. For each control, send an order designed to breach it and confirm the rejection, the log entry and the alert. Repeat after every platform change and at least quarterly.
- Write an incident runbook. For the most likely incidents (runaway orders, stale data, lost connection, position break) it states who is called, who can stop trading, and what is checked before trading resumes.
How do you score your current risk controls?
Rate each line from 0 to 2: 0 means the control does not exist, 1 means it exists but is inside the strategy, untested or has no owner, 2 means it is independent of the strategy, tested in the last quarter and has a named owner.
| Control | Score 0 to 2 |
|---|---|
| Maximum order size and order value on every order | |
| Price collar and market data reasonability check | |
| Message throttle that never blocks cancels | |
| Repeated execution limit and duplicate order check | |
| Position and exposure limits that include working orders | |
| Daily loss limits per strategy and for the firm | |
| Kill switch with selectable scope, tested in production conditions | |
| Cancel-on-disconnect confirmed with the broker or venue | |
| Drop copy or position reconciliation, breaks investigated same day | |
| Alerts with a named owner and a written first action | |
| Limits register and controlled change process | |
| Incident runbook and scheduled control tests |
Read the total out of 24 as a guide to priorities, not as a grade.
- 20 to 24: the framework is in place. Concentrate on testing and on keeping limits current as strategies change.
- 12 to 19: the controls exist but depend on people or on the strategy code. Move the hard limits out of the strategy first.
- Below 12: reduce size or pause new strategies until the pre-trade limits and the kill switch are independent and tested.
Any single line that scores 0 is a gap to close whatever the total says.
What does a 30-day plan to close the gaps look like?
Days 1 to 5: inventory. List every strategy, every route to market and every existing limit, including limits at the broker. Note where each limit is enforced. Complete the scorecard above with someone who did not build the strategies.
Days 6 to 12: hard limits. Agree order size, order value, price collar, position and daily loss limits for each strategy and for the firm. Implement them in the platform or gateway. Record them in a limits register.
Days 13 to 18: emergency controls. Build or configure the kill switch with selectable scope. Confirm cancel-on-disconnect with the broker or venue. Name the people who can stop trading and make sure each of them has done it once in a test.
Days 19 to 24: monitoring and reconciliation. Set up heartbeats, behaviour alerts and reconciliation against the broker’s records. Give each alert an owner and a first action.
Days 25 to 30: test and document. Breach every control on purpose and keep the evidence. Write the incident runbook. Schedule the next test and the first limits review.
A strategy that has not yet gone live should pass through the same steps as part of its release. If the strategy itself is still in research, start one step earlier and check it for backtest overfitting: controls limit the damage a strategy can do, but they do not make a curve-fitted strategy sound.
How does platform design make risk controls easier to enforce?
Controls are easier to enforce when every strategy reaches the market through the same place. If ten strategies are ten separate programs, each with its own connection, there are ten sets of limits to maintain and no single point from which to stop them. If they run in one environment, limits and the stop control can be applied once, to all of them, and the firm-wide totals are available without stitching logs together.
That is one reason we built DBATE, the algorithmic trading platform from AlgoEdge Labs, as a single environment: strategies are designed in a graphical strategy builder, backtested, and executed through the Interactive Brokers TWS API, with many strategies able to run in parallel. The platform is available to institutional clients and funds. No platform replaces a firm’s own risk policy, its limits or its people. What a shared environment does is remove the gaps between separate tools, where controls are most often missing.
Frequently asked questions
What is the difference between pre-trade and post-trade risk controls?
Pre-trade controls check an order before it is sent and reject it if it breaks a limit, such as maximum size, value or price distance. Post-trade controls compare what was executed with what the system expected, using reconciliation against the broker’s or exchange’s records. Pre-trade controls prevent an error. Post-trade controls detect the errors that got through.
Is a stop-loss a risk control?
A stop-loss is part of the trading logic. It manages the risk of a position when the strategy is working as designed. A risk control is independent of the strategy and still works when the strategy is faulty. An institutional setup needs both, and should not count the first as the second.
Does a kill switch close open positions?
Not necessarily. A kill switch blocks new orders and cancels working orders. Whether positions are also closed is a separate decision, because closing quickly in a thin market has a cost of its own. Decide the policy in advance and record who has the authority to flatten.
Are broker and exchange risk limits enough on their own?
No. They are a useful backstop, and they keep working if your own systems fail, but they are set to protect the broker and the market. They are usually much wider than the limits your own risk policy would choose, and they know nothing about what is normal for an individual strategy.
How often should risk controls be tested?
After every change to the platform, the connection or the limits, and on a fixed schedule in between, at least quarterly. A test means sending an order designed to breach the control and keeping the evidence that it was rejected, logged and alerted.
Related guides
- Algorithmic Trading Technology guide: from first backtest to live trading
- Algorithmic Trading Go-Live Checklist: From Backtest to Live Trading in 7 Stages
- Backtest Overfitting: How to Spot a Curve-Fitted Trading Strategy and Reduce the Risk
Next step
If your team is reviewing how its strategies are limited, monitored and stopped, we can show how DBATE runs strategy design, backtesting and execution in one environment. Visit our algorithmic trading page to send an institutional inquiry, or contact us directly.
AlgoEdge Labs LLC provides trading software and technology. Nothing in this article is investment advice. Trading involves risk, including the possible loss of capital.