Algorithmic & Systematic Trading
Systematic trading means every decision — entry, exit, position size — comes from fixed rules written in advance; algorithmic trading means a computer executes those rules. The appeal is consistency: the same situation always gets the same response, and the rules can be tested on historical data. The danger is that a backtest is easy to make look good and much harder to make honest.

A hypothetical idea: "Buy when the trend turns up, sell when it turns down." As written, a computer cannot trade it. As a rule set, it might read:
- Market: one liquid stock index future, daily bars.
- Entry: buy at the next open when the 20-day moving average of closes crosses above the 100-day moving average.
- Exit: sell at the next open when the 20-day crosses back below the 100-day.
- Size: risk 1% of the account, with a stop 3 × the 20-day average daily range below entry.
- Costs: assume $15 per round trip including slippage (hypothetical).
Every word is now testable, and two people coding it would get the same trades.
Now the cost hurdle. On a hypothetical $50,000 account at $15 per round trip:
- 12 trades a year: $180 = 0.36% of the account.
- 250 trades a year: $3,750 = 7.5%.
- 1,000 trades a year: $15,000 = 30%.
A slow system barely notices its costs. A fast one must earn 7.5% or 30% a year before it makes a cent.
From idea to rules
Writing rules forces decisions that discretionary traders often leave vague: which data (closing price or intraday?), when orders are placed (at the signal bar's close or the next open?), what happens on gaps, holidays and contract rolls, and how size is set. Each choice changes the results, and each must be fixed before testing. If you cannot write a rule down, you cannot test it — and you cannot be sure you are following it.
How backtests lie
- Overfitting. Test 200 combinations of moving-average lengths and keep the best, and the winner will look good partly by luck — even if none of them has a real edge. The more parameters and combinations you try, the more the best result is flattered.
- Look-ahead bias. Using information that was not available at the time — for example, trading at a bar's close using a signal calculated from that same close, or using revised economic data.
- Survivorship bias. Testing stock strategies only on companies that still exist today ignores those that went bankrupt or were delisted, which inflates results.
- Missing costs and unrealistic fills. Assuming every order fills at the signal price with no commission, fee or slippage.
Honest testing habits
- Split the data: develop on one period (in-sample) and confirm on a later period you have never looked at (out-of-sample).
- Walk-forward testing: repeatedly fit on a window, test on the next window, and roll forward. It shows how the strategy would have behaved if you had re-fitted it in real time.
- Few parameters, wide plateaus: prefer rules that work across a range of settings (say 80–120 days) rather than only at one precise value.
- Paper trade, then trade small: compare live fills and costs with what the backtest assumed before increasing size.
The cost hurdle by trade frequency
Exact arithmetic on a hypothetical all-in cost of $15 per round trip. Real costs depend on the instrument, broker and order type — use your own figures.
Slippage deserves its own line in the test. A backtest that fills every stop exactly at the stop price will look better than live trading, where stops in fast markets often fill a tick or more beyond it. A simple conservative habit is to add at least one tick of slippage to every market-order fill and see whether the strategy survives.
This is why systematic styles mirror their discretionary cousins on costs: a slow trend-following system resembles position trading, while a high-frequency intraday system faces scalping-level cost pressure.
Execution risk
Once a strategy runs automatically, new failure modes appear: a bug that sends orders repeatedly, a data feed that delivers a bad price, a lost connection while positions are open, or a contract roll the code did not handle. Professional systems protect against these with hard limits — maximum position size, maximum orders per minute, a daily loss limit that stops trading — and with a way to flatten everything manually.
Rules, capital and fit
Automation does not change the regulations. An algorithm that day trades US stocks in a margin account is subject to the pattern day trader rule (four or more day trades in five business days requires $25,000 minimum equity); the rule does not apply to futures accounts. Brokers also have their own terms for automated or API trading. Rules change — check the current versions.
Systematic trading suits people who like research and building things, who are comfortable with code or willing to learn, and who can trust a tested process through a drawdown instead of overriding it. It is time-heavy up front and lighter afterwards, but never zero: systems need monitoring, data maintenance and periodic review. It is not inherently more or less profitable than discretionary trading; it is a different way of making and enforcing decisions.
Common mistakes
- Optimizing until the equity curve is smooth, then being surprised when live results differ.
- Ignoring costs or modelling fills that would never happen.
- Overriding the system after a few losses, which leaves you with neither a system nor discretion.
- No safeguards against technical failure.
1. A strategy makes 400 trades a year at $10 per round trip on a $40,000 account. Yearly cost hurdle?
2. Using a bar's closing price to generate a signal and also assuming a fill at that same close is an example of what?
3. Why does testing 200 parameter combinations and keeping the best one inflate results?
4. What is the purpose of out-of-sample data?