From Backtest to Live: Why Algorithmic Trading Strategies Break in Production
A strategy that looks brilliant in a backtest can bleed money in its first live month. The causes are predictable: biased data, ignored costs, overfitting and fragile execution. Here is how to catch each one before capital is at risk.
Every trader who has automated a strategy knows the feeling. The backtest equity curve climbs smoothly from bottom left to top right. You go live. Within weeks the real curve has flattened, or worse, and nothing in the code has changed.
The strategy did not stop working. In most cases it never worked the way the backtest said it did. The gap between simulated and live performance is not bad luck; it comes from a short list of well-understood mistakes. Here they are, roughly in the order I see them, with what to do about each.
1. The data knew the future
Look-ahead bias is the most common and the most flattering error. It creeps in whenever the backtest uses information that was not available at the moment of the decision:
Using the day's close to generate a signal, then assuming you filled at that same close.
Using fundamental data stamped with the period end rather than the date it was actually published.
Using an indicator that is calculated over the whole dataset, such as a normalisation, a regime label or a volatility estimate.
The fix is a strict rule: every value the strategy reads must have a timestamp no later than the decision time, and fills happen after the signal, at a price you could realistically have got.
2. The universe only contains survivors
If your stock universe is today's index members, your backtest quietly excludes every company that went bankrupt, was delisted or got dropped from the index along the way. That is survivorship bias, and it inflates returns most for strategies that buy beaten-down names, which are exactly the ones that sometimes go to zero.
Use point-in-time constituents and include delisted securities with their final returns. It is more data engineering work, and it is not optional.
3. Costs were an afterthought
A strategy that trades often can be wildly profitable before costs and a steady loser after them. A realistic cost model includes:
Commissions and exchange fees, per your actual broker schedule.
Spread: you buy at the ask and sell at the bid, not at the mid.
Slippage and market impact, which grow with order size relative to volume.
Financing and borrow costs for leveraged or short positions.
A useful habit: plot net return against an assumed cost per trade. If the edge disappears at a cost only slightly worse than your estimate, the strategy is too fragile to deploy.
4. The strategy was fitted to noise
With enough parameters, you can fit any historical series beautifully. Overfitting shows up as a backtest that is excellent with one exact parameter set and mediocre with its neighbours.
Signs you are fitting noise:
Performance collapses when you nudge a lookback from 20 to 22 days.
The strategy needs many rules to explain a handful of large winners.
You tested dozens of variants and kept the best one without adjusting for the number of trials.
The defences are walk-forward testing (optimise on one window, test on the next, roll forward), keeping a genuinely untouched out-of-sample period, and preferring strategies whose performance surface is a broad plateau rather than a sharp peak. The companion article on our quantitative research workflow covers validation in more depth.
5. The market changed
Markets move through regimes: trending and mean-reverting, calm and volatile, liquid and stressed. A strategy tested only through one long bull market has not been tested.
Break your results down by regime and by year. You do not need a strategy that wins everywhere; you need to know where it loses and size it accordingly.
6. Execution was assumed, not engineered
Even a correct backtest assumes a perfect execution environment. Live trading adds:
Orders that are partially filled or rejected.
Latency between signal and order, and between order and fill.
Data feed gaps, duplicate ticks and bad prints.
Broker API outages at the worst possible moment.
Production systems need state reconciliation (what the system thinks it holds versus what the broker says it holds), idempotent order handling, and alerts the moment those two disagree.
A pre-deployment checklist
Before a strategy touches real capital, we want a clear yes to each of these:
Check
Question
Point-in-time data
Could every input have been known at decision time?
Survivorship
Does the universe include delisted and removed securities?
Costs
Is the edge still there at 1.5× your estimated costs?
Robustness
Do neighbouring parameter values perform similarly?
Out-of-sample
Was a holdout period kept untouched until the end?
Regimes
Do you know which conditions hurt the strategy?
Risk limits
Are position, loss and exposure limits enforced in code?
Kill switch
Can a human flatten everything in one action?
Paper trading
Has it run live, without capital, long enough to compare against the backtest?
Paper trade, then scale slowly
The last step is the one people skip because they are excited: run the strategy live on paper first, then with small size, and compare every fill against what the backtest would have done on the same days. The differences tell you exactly which assumption was wrong.
A backtest is a hypothesis, not a result. Treat it with the same scepticism you would apply to someone else's pitch, and the strategies that survive will be the ones worth trading.
If you are taking a strategy from research to production, this is the work our trading agents and institutional trading systems teams do every day: data pipelines, backtesting, execution and the risk controls in between.