Trading system: what it is and how to build an automated one
A trading system is a complete, written set of rules for entry, exit, position size and risk, so that two people following it on the same data make the same trades. An automated system runs those rules on a computer. Build it in a fixed order, freeze the rules before you see results, and monitor live trades against the backtest's own numbers.
By Soren Huang · Published · updated · Editorial policy
Contents
- What is a trading system?
- What is an automated trading system?
- Which components does every trading system need: entries, exits, sizing and risk?
- How do you build an algorithmic trading system step by step?
- What does a backtest of a one-rule system look like?
- How do you test and monitor a trading system after you build it?
- Frequently asked questions
- References
What is a trading system?
A trading system is a complete, written set of rules that says when to enter a trade, when to exit, how many contracts to trade and how much to risk. Two people following the same system on the same data make the same trades. An automated trading system runs those rules on a computer that reads prices and sends orders by itself.
Think of the difference between a list of ingredients and a recipe. An indicator is an ingredient. A trading system is the recipe: it says what to do with each ingredient, in what amount, and when to stop. Most traders who say they "have a system" have an entry signal, such as a moving-average cross or a breakout, and nothing else written down. That is the claim this article tests from several sides: a precise entry with a vague exit and no sizing rule is not a system, and it cannot be tested or automated.
The test of completeness is simple. Give the rules to a friend with the same price data and no further explanation. If your friend asks "what do I do if the trade goes against me?" or "how many contracts?", the system is not finished. Pardo (2008) builds the whole evaluation of a trading system on this point: a rule can be tested only when every part of it is fully specified before the test starts.
What is an automated trading system?
An automated trading system is the same written rules run by a computer that reads prices, decides and sends orders without a person in the loop. The rules do not change. What changes is who performs each step. The computer never hesitates and never skips a signal, but it also never notices that a rule is wrong, that the data feed has stopped, or that a contract rolled last night.
| Step | Discretionary trader | Manual rule follower | Automated system |
|---|---|---|---|
| Watch prices | Person, by judgement | Person | Computer |
| Decide to trade | Person, by judgement | Person, from the rules | Computer |
| Send the order | Person, by judgement | Person | Computer |
| Size the position | Person, by judgement | Person, from the rules | Computer |
| Record the trade | Person, by judgement | Person | Computer |
The middle column matters more than it looks. A manual rule follower is already running a trading system, by hand. Automating it changes execution speed and discipline, not the logic. If the rules cannot be followed by hand from a written page, they cannot be automated either. The wider picture of what automation costs and why most rules lose after costs is in algo trading: what it is and what it costs.
One term is often confused with this. An alternative trading system is not a strategy at all. In the United States it is a trading venue that matches buy and sell orders outside a traditional exchange and is regulated as such. When you read "ATS" in a regulatory document, it means a place where orders meet, not a set of rules a trader follows.
Which components does every trading system need: entries, exits, sizing and risk?
A system needs all four components written as testable conditions, and the most common failure is a precise entry paired with a vague exit and no sizing rule at all. A testable condition is a sentence a computer can check on each bar and answer yes or no. "Buy when it looks strong" cannot be checked. "Enter long at the open of the following bar when today's close is above the highest high of the past 20 days" can.
| Component | Vague version | Testable version | What happens if it is missing |
|---|---|---|---|
| Entry | Buy when it looks strong | Enter long at the open of the following bar when the close is above the 20-day high | Nothing to test; every trade is a judgement call |
| Exit | Get out when it turns | Close the position at the open of the following bar when the close is below the 10-day low, or after 15 bars in the trade | Trades never close on a rule; results depend on the trader's mood |
| Position size | Trade what feels right | Contracts = account risk per trade ÷ (stop distance in points × point value), rounded down | One loss can be ten times another; the equity curve says nothing about the rules |
| Risk limits | Don't lose too much | Stop trading for the month when the month's loss reaches 6 percent of the account | A bad stretch has no end point; the system is switched off by panic instead of by rule |
Position sizing is the rule that converts a signal into a number of contracts, usually from the account risk you accept per trade and the distance to the stop. The free position size calculator does this arithmetic for a given account risk and stop distance. The sizing rule in the table needs three numbers. The first is the dollar amount you accept losing on one trade. The second is the stop distance in index points. The third is the point value, which is the dollar change of one contract when the index moves one point. Exchanges can change point values and tick sizes, so check the exchange's contract page or the free futures contract calculator before you fix the number.
Hypothetical example
Suppose a trader accepts a $500 loss per trade, the stop sits 30 points from the entry, and each index point is worth $20 (the E-mini Nasdaq-100 multiplier on CME's contract page). Contracts = $500 ÷ (30 × $20) = $500 ÷ $600 = 0.83, rounded down to 0. The rule says: do not take this trade at this size. With a 20-point stop the result is 1.25, rounded down to 1 contract. A sizing rule that returns zero is doing its job.
Risk limits are the rules above the level of a single trade: a maximum loss per day, per month or from the equity peak, after which the system stops. Entry and exit decide whether the rules have an edge. Sizing and risk limits decide whether you are still trading when the edge shows up.
How do you build an algorithmic trading system step by step?
Build in a fixed order, from one idea stated in one sentence to a written monitoring plan, and never skip the step where you write the rules before you look at results. The order exists because each step protects the next one. Rules written after seeing a backtest describe that backtest; rules written before it can be tested by it.
- State the idea in one sentence. "After a strong close above the recent range, the index tends to continue for a few days." If it does not fit in one sentence, it is two ideas. The five rule families that fit futures, and how each is tested, are in futures algo trading strategies: 5 types.
- Write all four rule blocks on paper. Entry, exit, position size, risk limits, each as a testable condition. Write the parameter ranges you will search as well, for example a lookback of 10 to 40 days.
- Set costs, sessions and execution. Commission and slippage per trade, the trading session the rules apply to, and execution on the next bar after a signal. These settings change results more than most parameter choices.
- Backtest on the in-sample period. In-sample data is the earlier part of the history that you use to choose settings. Read the average trade after costs and the trade count before anything else.
- Validate on unseen data. Run the frozen rules on the out-of-sample period and in a walk-forward test. The next two sections explain what each catches.
- Run small live. One contract, or a micro contract, long enough to collect real fills and compare them with the backtest's slippage setting.
- Write the monitoring plan. Which numbers you compare, how often, and at what point you switch the system off. Write it before the first live order.
The padlock is the step people skip. It is tempting to run a few backtests first and "see what works", then write down whatever looked best. A rule chosen that way has already seen the exam questions. The full research routine around these steps, from data to a reviewed strategy, is laid out in how to build a quantitative trading process from scratch. For an intraday version of the same route, with session times and the costs that intraday rules must beat, see how to build and test a day trading algorithm.
What does a backtest of a one-rule system look like?
A real run of a one-rule system shows what a bare entry-and-exit rule produces and, more usefully, what it is missing. The run below used NQ daily bars from 2019-01-02 to 2025-06-30, long and short, one contract, with $20 commission and $10 slippage charged on every trade. Its only entry and exit was a rule built from the DMI indicator, with no stop, no target and no filter. It is a stand-in built from a standard indicator to illustrate the shape of a one-rule report, not a recommendation of that rule. AlphaPrime (Valynox) searched 1,024 candidates and kept this one for its return against its drawdown.
Source: AlphaPrime product engine (CPU), run 2026-10-31. NQ daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $10 slippage per trade.
| Number | Result |
|---|---|
| Net profit (closed trades) | $50,370 |
| Max drawdown | $21,320 |
| Trades | 76 |
| Win rate | 59.21% |
| Profit factor | 1.702 |
| Average trade | $662.76 |
| Time in market | 7.72% |

Read the report in this order. First the trade count: 76 trades over six and a half years is a small sample, so every per-trade figure is a hint rather than a measurement. Second the average trade, $662.76 after the $30 of costs charged per trade, which tells you how much slippage the rule could absorb before its result reached zero. Third the maximum drawdown, $21,320 with one contract and no stop; that number is the loss a trader of this rule would have had to sit through, and it came from the exit rule alone because nothing else was limiting it. Time in market of 7.72 percent says the rule was flat most of the time, which is a fact about the rule, not a merit. In AlphaPrime the Performance Report puts the trade list, the drawdown curve and the long and short breakdown next to these summary lines, so you can see which trades made the average and when the drawdown happened.
What this report is missing is exactly the two blocks from the components section. There is no position-sizing rule, so one contract is one contract regardless of volatility. There are no risk limits, so the drawdown ran as far as the exit rule let it. A complete system built on this entry would add both and then be tested again, because adding them changes every number in the table.
The last thing to know about this table is how the candidate got there. It is the best of 1,024 tries, chosen after the fact. Bailey, Borwein, López de Prado and Zhu (2014) show that the best backtest in a search of that size looks better than the rule deserves, simply because the search picked the luckiest. The numbers are a true record of what the kept candidate did on this data, and they are flattered by the selection. Nobody should read them as money the rule earned or as what a reader could expect. The next step for a candidate like this is the unseen data.
How do you test and monitor a trading system after you build it?
Testing happens in stages that each catch a different kind of error, and monitoring means comparing live trades with the backtest's own numbers against a stop rule written before the first live order. No single test catches everything. An in-sample backtest finds a broken rule; it cannot find curve fitting, because the rule was chosen on that data. An out-of-sample test finds curve fitting; it cannot find bad fill assumptions, because it uses the same simulated fills. Only live trades show real slippage.
| Stage | What it catches | What to compare |
|---|---|---|
| In-sample backtest | Rule errors, look-ahead leaks, cost sensitivity | Average trade after costs against the round-trip cost; result with doubled slippage |
| Out-of-sample test | Curve fitting to the tuning period | Out-of-sample average trade after costs against the in-sample figure |
| Walk-forward | Settings that only worked once | Joined out-of-sample curve against the single in-sample curve; neighbouring settings |
| Small live run | Slippage and fill assumptions, data and roll handling | Live fill prices against the signal prices the backtest used |
| Ongoing monitoring | Drift from the backtest | Live drawdown against the backtest max drawdown ($21,320 in the run above) as the reference line; live average trade against the backtest average |
Walk-forward analysis is a test that tunes settings on one window of history, runs them unchanged on the window that follows, moves forward and repeats, so that every out-of-sample segment was traded with settings chosen before its data existed. It is the closest a backtest comes to the order of events in live trading. A system whose settings change a lot from window to window, or whose joined out-of-sample curve is flat, is telling you that the in-sample result came from fitting rather than from the idea.
Monitoring uses the backtest as the reference, not as a promise. Two comparisons do most of the work. The first is the live average trade after costs against the backtest average: if the live figure is far below it after a reasonable number of trades, the fill assumptions were wrong or the market changed. The second is the live drawdown against the backtest's maximum drawdown. A live drawdown deeper than anything in the backtest is new information about the rule. Write down in advance what you will do when that line is crossed, because a decision made in the middle of a drawdown is the one the risk-limits block was meant to replace.
Hypothetical example
A trader's monitoring plan says: compare after every 20 live trades; stop the system if the live average trade after costs is below zero at that point, or if the live drawdown exceeds 1.5 times the backtest maximum drawdown at any time. After 20 trades the live average trade is $180 against a backtest figure of $400, and the live drawdown is $6,000 against a backtest maximum of $9,000. Neither stop rule has fired, so the system keeps running, and the trader notes that live slippage was higher than the setting used in the backtest.
A concrete thing to do next: take the strategy you trade or plan to trade and write its four blocks on one page, in the testable form from the components table. If any block is empty or reads like the vague column, that block is where the next hour of work goes, before any backtest is run.
Frequently asked questions
What is an automated trading system?
An automated trading system is a written set of trading rules run by a computer that reads prices, decides when to enter and exit, sizes the position and sends the orders without a person in the loop. The rules are the same as in a manual system; only the performer changes. Automation removes hesitation and skipped signals, but it also removes the person who would notice a wrong rule or a stopped data feed, so monitoring becomes part of the system.
How do you create an algorithmic trading system without coding?
Write the four rule blocks, entry, exit, position size and risk limits, as testable conditions on paper first. Then use a strategy-research program that turns those conditions into a backtest with costs, sessions and next-bar execution, validates the result on unseen data, and exports the finished rules as source code for your trading platform. The thinking part, which is writing the rules before you see results, is the same with or without code.
What is an alternative trading system?
An alternative trading system is a trading venue, not a strategy. In the United States it is a place that matches buy and sell orders outside a traditional exchange and is regulated as a venue. When a document mentions an "ATS", it is talking about where orders meet. A trading system in the sense of this article is the set of rules a trader follows to decide which orders to send.
Is a trading system the same as a trading strategy?
In everyday use the words overlap, but a system is the complete version. A strategy is often just the idea and the entry signal. A system adds the exit, the position-sizing rule and the risk limits, each written so that a computer could check it on every bar. The quick test is whether a stranger with the same data would make the same trades without asking a question.
How many trades does a system need before a backtest means anything?
Enough that the average trade cannot move much if a few trades change. Fewer than about 30 trades is a hint rather than a result, and many systematic traders want a few hundred before they trust a per-trade figure. A run with 76 trades, like the one in this article, tells you the shape of the rule's behaviour but not its average with any precision, which is one reason the next step for such a candidate is more data, not a live account.
References
- Pardo, R. (2008). The Evaluation and Optimization of Trading Strategies (2nd ed.). John Wiley & Sons.
- Bailey, D. H., Borwein, J., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458–471.
- CME Group. E-mini Nasdaq-100 Futures Contract Specs. https://www.cmegroup.com/markets/equities/nasdaq/e-mini-nasdaq-100.contractSpecs.html

