What is a backtest? In-sample, out-of-sample and walk-forward
A backtest replays a strategy on past prices. Learn why testing on unseen data and walk-forward testing make results more honest.
A backtest is a simulation. You take a set of trading rules, apply them to past price data, and calculate what would have happened: which trades would have been made, and what the profit or loss would have been. It answers the question "how would this idea have done if I had used it before?"
Rule: "Buy BTC when the price closes above its 50-day average. Sell when it closes below." A backtest goes through every day of, say, 2018 to 2024, applies the rule, records each simulated trade, and adds up the results. It might report 40 trades, 15 winners and a total return of some percentage.
Pro unlocks all 72 Academy lessons, every quiz and the practice challenges. Six modules stay free forever.