Home/Glossary/Backtest
Statistics & testing

What is backtest?

A backtest is a simulation of how a trading rule would have performed on historical data, used to estimate its edge, drawdowns and costs before any money is at risk.

A useful backtest uses only information available at each decision point, includes fees, slippage and funding, counts every signal including the failures, and compares the result with a simple alternative such as buying and holding or entering at random. It describes the past under the assumptions you chose; it does not forecast. The more choices a backtest involves, the more its result can reflect those choices rather than the market.

Why it matters

A backtest is the cheapest way to find out that an idea does not work, and most ideas do not. It also produces the numbers a strategy needs before it is traded: how deep the drawdowns went, how long the losing streaks were and how sensitive the result is to costs and start date.

Example

Say you test buying BTC whenever it closes above its 200-day average and selling when it closes below, from 2018 to 2026, with a 0.1% fee per trade. The result should be read next to buy-and-hold over the same years: total return, maximum drawdown, number of switches, and how the outcome changes if the test starts in a different year. The DCA backtester runs this kind of comparison for regular buying.

Common mistakes

  • Leaving out fees and slippage, which hurt rules that trade often the most.
  • Testing only coins that still exist today, which leaves out the ones that failed.
  • Reporting only the best of many runs, which is overfitting.
  • Acting on a bar’s close within that same bar, which is lookahead bias.

Questions

Can a backtest prove a strategy works?

No. It can show that a rule had an edge in the past under stated assumptions, and it can rule ideas out. Markets change, and an edge that existed can disappear.

What should a backtest report?

The number of trades, win rate with average win and loss, expectancy after costs, maximum drawdown, a comparison with a simple benchmark and the results from different start dates.

Related terms

Part of the crypto trading glossary. Definitions are educational, not financial advice.