Backtesting applies your trading strategy to historical data to see how it would have performed. It’s essential before risking real money.
Why Backtest
| Reason | Benefit |
|---|
| Validate your strategy | See if it works historically |
| Find weaknesses | Identify conditions where it fails |
| Optimise parameters | Find the best settings |
| Build confidence | Reduces emotional trading |
| Estimate performance | Win rate, drawdown, Sharpe ratio |
Backtesting Methods
| Method | Accuracy | Effort |
|---|
| Manual (on charts) | Low | High |
| Spreadsheet | Medium | Medium |
| Automated (code) | High | Low (after setup) |
| Platform (TradingView) | Medium | Low |
Key Metrics to Track
| Metric | What It Measures |
|---|
| Win rate | Percentage of winning trades |
| Average win | Average profit per winning trade |
| Average loss | Average loss per losing trade |
| Profit factor | Gross profit / gross loss (> 1.5 is good) |
| Max drawdown | Largest peak-to-trough decline |
| Sharpe ratio | Risk-adjusted return (> 1 is good) |
| Number of trades | Sample size (more = more reliable) |
How to Backtest Properly
| Step | Action |
|---|
| 1 | Define clear, non-ambiguous rules |
| 2 | Choose a representative data period |
| 3 | Include all trading costs (spread, commission) |
| 4 | Run the test on out-of-sample data |
| 5 | Record every trade |
| 6 | Analyse the results |
| 7 | Forward-test on live data |
Sample Size Requirements
| Trades | Reliability |
|---|
| Under 30 | Not statistically significant |
| 30-100 | Low confidence |
| 100-200 | Moderate confidence |
| 200+ | High confidence |
Common Backtesting Mistakes
| Mistake | Why It’s Dangerous |
|---|
| Overfitting | Too many parameters tuned to past data |
| Look-ahead bias | Using future information in the test |
| Survivorship bias | Only testing assets that still exist |
| Ignoring costs | Spread and commission eat profits |
| Data snooping | Testing many strategies, reporting only the best |
| Small sample | Not enough trades to be meaningful |
Overfitting Warning Signs
| Sign | Problem |
|---|
| Strategy is too complex | Too many rules and filters |
| Amazing backtest results | 90%+ win rate is suspicious |
| Fails in forward testing | The classic sign of overfitting |
| Works only on specific data | Fails on different periods or assets |
Forward Testing
After backtesting, forward-test (paper trade) for the same number of trades or 1-2 months:
| Phase | Duration | Purpose |
|---|
| Backtest | Historical | Validate concept |
| Forward test | 1-2 months | Validate in real time |
| Live trading | Ongoing | Execute with small size |
Bottom Line
Backtesting validates your strategy before risking money. Test on enough data (100+ trades), include all costs, and watch for overfitting. A good backtest doesn’t guarantee future performance, but a bad backtest guarantees future losses. Always forward-test before going live. Keep your strategy simple — if it only works in backtesting, it doesn’t work.
This content is for educational purposes only. Not financial advice. Do your own research before investing.