Backtesting a Trading System: Metrics and Limits
Evaluate a trading backtest using profit factor, expectancy, and drawdown. Learn how fees, overfitting, look-ahead bias, and out-of-sample tests affect results.
By Kru Kook (Krittiya Khunabrimas)
What a backtest can tell you
A backtest applies clearly defined rules to historical data to estimate how they would have performed under those data and assumptions. It does not prove that a strategy will behave the same way in the future. A strong historical result is a starting point for further checking, not a profit guarantee.
Core metrics
- Profit factor: Gross profits from winning trades divided by the absolute gross losses from losing trades. State whether it is before or after costs.
- Expectancy: Average net result per trade, calculated from win rate and average wins/losses or from each trade’s net result.
- Maximum drawdown: The largest decline from an equity peak to a subsequent low during the period.
- Trade count and result distribution: These show whether the total came from many trades or depended on a few large wins.
Profit factor and cost example
Assume a backtest has THB 18,000 of gross winning trades and THB 12,000 of gross losing trades. Pre-cost profit factor is 18,000 ÷ 12,000 = 1.5. If estimated total costs are THB 4,000, net P&L is 18,000 − 12,000 − 4,000 = THB 2,000 profit.
A 1.5 pre-cost profit factor can mislead if actual costs exceed the assumption. Explain how costs were counted and whether open trades were included.
Drawdown and recovery example
If equity peaks at THB 50,000 and then falls to THB 42,500, drawdown is (50,000 − 42,500) ÷ 50,000 = 15%. Returning from THB 42,500 to THB 50,000 requires 7,500 ÷ 42,500 = about 17.65% growth because the calculation starts from a smaller base.
This illustrates drawdown arithmetic; it does not predict that an account will recover.
Biases to check
- Look-ahead bias: Using data that was not available at the time of a simulated decision.
- Overfitting: Tuning parameters to match one historical sample.
- Incomplete costs: Omitting spread, slippage, fees, or partial fills.
- Unrepresentative data: Excluding market periods or using biased samples.
- Repeated testing: Selecting only the best result without reporting how many variants were tried.
Separate data used to design rules, data used for validation, and an out-of-sample period not used for parameter selection. When possible, use a forward test in simulation or at controlled size and record differences from the backtest.
Make the report auditable
- Write entry, exit, and sizing rules so another person can reproduce them.
- State the product, timeframe, data period, and data source.
- Explain costs, fills, and treatment of missing data.
- Report trade count, net results, drawdown, and losing periods.
- Compare different market conditions rather than highlighting only the best period.
Historical data is one part of evaluation. Check forward results before drawing conclusions.
