A backtest applies a trading rule to historical prices to see how it would have behaved. It is a checking tool, not a crystal ball.
What a backtest is
The US SEC puts it this way: back-testing applies a strategy to past market conditions to show how it may have performed. Back-tested performance is hypothetical and does not reflect actual performance (SEC / Investor.gov).
The steps of a backtest
- Write a precise rule: when to enter, when to exit, what position size.
- Pick a long period that contains both rises and falls.
- Include realistic fees and price slippage.
- Read the results: total gain or loss, worst drop (drawdown), number of trades, share of winning trades.
- Check the rule on another period it has not "seen".
On the Trading bot page, bots are tested on real historical prices with simulated fees and slippage, and the optimiser checks every setting on a period it has not seen. Everything stays in paper money.
Traps to avoid
- Overfitting: tuning a rule until it fits the past perfectly. It is then likely to fail.
- Cherry-picking: showing only the good periods. The SEC warns about "cherry-picked" performance.
- Forgetting fees: many small trades can turn an apparent gain into a loss.
- Confusing past and future: past performance does not predict future performance.
After the backtest
Keep going with paper money in the simulator to see the rule on live prices, and read the charts in Analysis. For exit rules, see Stop-loss and take-profit explained.