From Backtest to Live: Paper, Shadow and Canary
Why live results almost always trail backtests, how to measure the gap, and a staged plan for taking a strategy from backtest to paper trading to real money.
Almost every strategy performs worse live than in its backtest. Some of the gap is unavoidable: the backtest was fitted to the past and the future is different. Much of it is avoidable: optimistic cost assumptions, fills that would never happen, data the live system cannot see and bugs in the code. The goal of moving from backtest to live is not to make the gap disappear but to understand it, keep it small and catch problems while positions are still small. This lesson focuses on algorithms; Moving From Paper to Live Trading covers the same move for discretionary traders.
Where the gap comes from#
| Source | Example | Lesson |
|---|---|---|
| Overfitting | Parameters tuned to past noise | Overfitting and Curve Fitting |
| Costs | Spread and slippage larger than assumed | Costs and Slippage in Backtests |
| Fill assumptions | Limit orders filled whenever price touched | Fill Models, Partial Fills and Order Queues |
| Look ahead bias | Using data before it was available | Look-Ahead Bias |
| Data differences | Live feed differs from historical vendor data | Cleaning Market Data |
| Latency | Signals acted on later than in the backtest | Latency in Trading |
| Regime change | Market behaviour shifts | Structural Breaks and Regime Changes |
| Capacity | Larger size moves the price | Alpha Capacity and Crowding |
A common rule of thumb among systematic traders is to expect live Sharpe ratios well below backtested ones, often around half, though this varies widely.
A staged rollout#
| Stage | Duration (typical) | Pass criteria |
|---|---|---|
| Out of sample and walk forward tests | Before any live data | Performance holds on unseen data |
| Paper trading on live data | Weeks to months | Signals match the backtest engine replayed on the same days |
| Small live size | 1 to 3 months or a set number of trades | Fills and costs match assumptions |
| Gradual scale up | Ongoing | Results stay within expected ranges |
Paper trading tests the code and data path, but not real fills and market impact. Small live trading tests those. See Paper Trading.
Measuring the gap: shadow comparison#
Each day, run the backtest engine over the same period the live system traded and compare:
- Signals: did both generate the same trades?
- Entry and exit prices: how much slippage did live trading suffer?
- Costs: were commissions and spreads as assumed?
- P&L: how much of the difference is explained by each factor?
When to stop or scale down#
Decide in advance what results would mean the strategy is broken rather than unlucky:
- Drawdown beyond the backtest's worst by a set margin. See Maximum Drawdown.
- Signal mismatch between live and backtest.
- Costs consistently above assumptions.
- Performance below a statistical threshold after enough trades. See Statistical Significance in Trading.
Writing these rules down before going live prevents rationalising losses later.
Common mistakes#
- Going straight to full size after a strong backtest.
- Paper trading too briefly to see a range of conditions.
- Not comparing live with backtest trade by trade.
- Changing the strategy mid test, which resets what you learned.
- Ignoring small discrepancies that later turn out to be bugs.
Frequently asked questions#
Why is live trading worse than backtesting?#
Overfitting, higher real costs, unrealistic fill assumptions, look ahead bias, data differences, latency and changing market conditions all reduce live results.
How long should I paper trade an algorithm?#
Long enough to see a meaningful number of trades and a range of market conditions; for many strategies that means several weeks to a few months.
How do I know if my strategy has stopped working?#
Set rules before going live, such as a drawdown limit beyond the backtest's worst, and compare live trades against backtest replays regularly.
Next, learn what to watch once an algorithm is running in Monitoring Positions, P&L and Risk.
3 quick questions on this lesson. Get them all right to finish it.
Turn on JavaScript to take the quiz.
Mentioned in
- Automated vs Semi-Automated TradingAlgorithmic Trading
- Developing, Testing and Monitoring AlgorithmsAlgorithmic Trading
- Risk Controls and Kill SwitchesAlgorithmic Trading
- Quant Trading Learning PathStart Here
- Building Trading BotsProgramming and Data
- Market Data ReplayProgramming and Data