TRADRILL / GLOSSARY / PRACTICE & SIMULATION
What Is Backtesting in Trading?
Category: Practice & simulationChinese: 回测
Short definition
Backtesting is applying a completely specified set of trading rules to historical market data to estimate how those rules would have performed — an estimate whose quality depends entirely on the rules being mechanical and the test avoiding hindsight.
What it means
The input must be a rule set a computer (or a very disciplined human) could execute without judgment: entry condition, exit condition, sizing, instrument universe, timeframe. Feed those rules a slice of history and out come statistics — trade count, win rate, average R, maximum drawdown. Those numbers describe the past interaction of the rules and the data; they are evidence about the future only to the extent the test was honest.
Honesty has a short list of failure modes, and nearly every inflated backtest fails on one of them. Look-ahead bias: using information the rules could not have had at decision time (a close that had not closed, a survivorship-cleaned list). Overfitting: tuning parameters until the past is perfectly explained, which is memorization, not discovery. Cost neglect: ignoring commissions, spread, and slippage — the silent killer of high-frequency rules. And selective windows: testing only the regime the strategy likes.
What backtesting is for: cheap elimination and rough sizing. It is excellent at showing that an idea never worked, and useful for bracketing a plausible range of performance. It cannot prove an edge persists — regimes change — which is why the discipline sequences it before forward testing (the same rules on unseen live data) rather than instead of it.
A backtest you can trust
Before believing the output, check the input against these:
- The rules are fully written — no discretionary "obvious" fills in the middle.
- Every decision uses only data available at that decision's timestamp.
- Costs are included per trade: commission + spread + your measured slippage.
- The sample spans multiple regimes, including at least one hostile one for the strategy.
- Parameters are few, chosen for a reason, and the result is not hypersensitive to small changes.
- Out-of-sample or walk-forward splits exist: data the rules were not tuned on.
A sane workflow
Backtesting earns its keep as the cheap first filter in a longer pipeline:
- 1.Write the rule set in full before touching data — entry, exit, sizing, universe, timeframe — including what the rules do when flat.
- 2.Choose a historical window with multiple regimes; keep a final segment untouched as out-of-sample.
- 3.Run the test with costs on; record trade count, win rate, average R, max drawdown, and the equity curve's shape, not just the totals.
- 4.Stress the parameters: if performance collapses with small changes, the edge is fitted, not found — simplify rather than retune.
- 5.Survivors graduate to forward testing on live data (still zero risk), then small live size — each stage with written pass criteria.
Frequently asked questions
Does a good backtest mean the strategy will work live?
No — it means the rules were not broken by history, costs included. Live performance adds regime change, execution reality, and your own discipline to the mix. A good backtest is permission to spend the next stage's time (forward testing), not a promise; the honest reading is always "this idea survives the cheapest test".
How much historical data do I need?
Enough to contain several regimes of the market and timeframe you trade — years for daily rules, months of dense data for intraday — and enough trades for statistics (dozens at minimum, ideally hundreds). The window matters more than its length: a single calm regime tells you nothing about how the rules behave in stress.
What is overfitting in practice?
Tuning until history is perfectly explained — many parameters, many attempts, one lucky combination. The tell is fragility: change a parameter slightly or shift the window and performance collapses. The cure is fewer parameters, reasons for each one, and out-of-sample data the tuning never touched; if the edge only exists in the tuned sample, it never existed.
Related terms & reading
Related terms: Bar replay · Paper trading · Expectancy
Keep reading: How Backtesting Works: A Beginner's Guide · Forward Testing vs Backtesting: What's the Difference? · Paper Trading vs Bar Replay vs Backtesting
Practice this term in simulation
Tradrill is an AI trading education platform where traders practice in a simulated trading terminal and get AI behavioral feedback that quantifies the real cost of habits like revenge trading, loss chasing and overtrading — with structured courses and weekly discipline reports, and no trade signals or auto-trading.
Educational content, not financial advice. Definitions describe trading behavior and risk concepts in general terms; they are not a recommendation to buy, sell or hold any instrument. AI-generated analysis. Not financial advice. Always do your own research.