Backtesting is trading a setup on past prices to estimate how it would have performed. You take the setup's rules, apply them to history and record every trade as if it were real: entry, stop, target, result in R. The outcome is a first estimate of the setup's win rate, expectancy and drawdown before any real money is at risk.
Two ways to backtest
- Automated. The rules are written as code and run over years of data in seconds. It is fast and exact, but only works for rules that can be coded without judgment.
- Manual. You step through the chart bar by bar with the future hidden and take the trades by hand. It is slow, but it tests the setup the way you actually trade it, judgment included, and trains your eye at the same time.
Why backtests look better than live trading
- Look-ahead bias. Using information that did not exist yet: a candle's close before it closed, a level drawn after the move, the day's high read in the morning. In manual testing it creeps in when you scroll ahead and come back.
- Hindsight. Remembering roughly what the market did that week. A symbol and a date you do not recognise keep the test honest.
- Ignoring costs. Spread, commission and slippage turn many small-edge setups from positive to negative. Put them in from the first trade.
- Small samples. Twenty trades say very little; see sample size. Aim for a hundred or more, across different market conditions.
- Curve fitting. Tweaking the rules until the past looks perfect produces a setup that fits that history and nothing else. Keep the rules simple and check changes on data you have not used yet.
- Practice is not live. A setup that earns 0.4R a trade in a backtest often earns less in the journal: hesitation, early exits, skipped signals. Compare the two numbers for the same setup.
In SetupBook
Backtest sessions are manual: pick a symbol, a start in the past, the timeframe, a balance, the risk per trade and the costs, then step or play bar by bar with the later candles hidden. Orders include market, limit, stop, stop-limit and OCO, sized by quantity or by risk. Optional settings test a setup from your playbook, apply prop firm rules or pick a blind symbol and date. The Stats tab shows win rate, expectancy, profit factor and max drawdown, and compares the setup's expectancy in practice with its expectancy in your journal. Stepping back marks the later trades as rewound, and practice trades never mix with your real ones. Backtesting is part of Pro; to review trades you already took, see trade replay.