What Is Backtesting? Conditions for a Trustworthy Test
Backtesting evaluates trading strategies by running them on historical data. A poorly constructed backtest, however, can produce results opposite to those seen in live trading.
What is backtesting?
Backtesting means applying defined trading rules to historical price data to simulate what would have happened if you had followed those rules then. For example, apply “buy when RSI falls below 30 and sell when it rises above 70” to a year of Bitcoin data, then calculate returns, win rate and maximum drawdown.
The key is that the rules must be explicit. Without numerically defined entry and exit conditions, a backtest is not possible. Backtesting can therefore turn intuitive trading into objective rules. Good historical results never guarantee future profits; the past does not repeat exactly.
Trap 1: Overfitting or curve fitting
Overfitting tailors rules to historical data alone. Repeatedly adjusting variables can align an equity curve precisely with past movements, but that is closer to memorizing history than developing a strategy.
Keep rules simple and check robustness: small changes to a variable should not destroy results. More parameters increase curve-fitting risk even when using familiar indicators such as RSI or MACD.
Trap 2: Look-ahead bias
Look-ahead bias uses information that was unavailable at the entry time. It is a common and difficult-to-detect error.
- Using the close to calculate an earlier entry: Reading a completed candle's close and then assuming a purchase within that candle uses a price not yet known.
- Using highs or lows: Assuming a purchase at the day's low looks into the future.
- Timezone errors: Misaligned timestamps can introduce data from hours ahead and distort the entire result.
Look-ahead bias can create unrealistically high win rates. Entry decisions must use only information actually available at that moment.
Trap 3: Ignoring fees and slippage
Omitting fees and slippage greatly inflates results. Costs can consume all profits, especially with leverage or frequent trading such as scalping.
| Measure | Ignoring fees | Including 0.1% round-trip costs across 200 trades |
|---|---|---|
| Gross return | +40% | +40% |
| Cost deduction | 0% | About -20 percentage points |
| Net result | +40% | About +20% |
Futures also incur funding costs. With more trades, costs can exceed the directional edge and turn the result negative. Estimate costs conservatively.
Conditions for a trustworthy backtest
Results failing the following conditions are reference checks, not evidence of live performance.
- 0 look-ahead bias: Verify that only entry-time information was used.
- Costs included: Account for fees, slippage and funding.
- Adequate sample: Too few trades may reflect chance; typically at least dozens are needed.
- Out-of-sample validation: Check periods different from the one used to develop the rules.
- Risk measures: Examine maximum drawdown (MDD) and the worst trade, not just returns.
- Forward or paper validation: Recheck stability through simulated trading as time actually unfolds.
Spectacular backtests deserve particular scrutiny. Backtesting is a tool for rejecting bad strategies, not a promise of future profits. Establish capital-management and stop-loss rules to limit damage if the evaluation proves wrong. Cryptocurrency trading risks loss of principal, even after a strong backtest.
NOONOO TRADING invites you to follow live trading in our free chat.
Start in the bot📈 OKX trading fee discount for new registrations
Register for the OKX Fee Discount →