How to Backtest a Trading Strategy Manually
A step by step method for backtesting a strategy by hand with bar replay: write the rules, pick a sample, step candle by candle, log trades in R, read results.
Backtesting means trading your rules on past data to see what they would have done. Done well, it tells you whether a strategy is worth practicing before any money is at risk. Done badly, it tells you what you hoped to hear. This is a method for doing it well, by hand, with bar replay.
Step 1: write the rules so someone else could follow them
Vague rules can't be tested. "Buy the pullback in an uptrend" means something different every time. Write rules a stranger could follow:
- Market and time: for example NQ, 9:30 to 11:30 New York time.
- Setup: what has to be on the chart, in plain checks.
- Entry: the exact trigger.
- Stop: where the idea is wrong.
- Target or exit: a fixed R, a level, or a rule.
- Filters: days or conditions you skip.
Freeze the rules before you start. Changing them halfway through the test makes the result meaningless.
Step 2: choose a sample that can surprise you
- Enough trades: 20 trades can't tell skill from luck. Aim for at least 100.
- Different conditions: trending and choppy days, quiet and busy months.
- Random days, hidden dates: if you pick the days or know them, you pick winners without meaning to.
Step 3: step through it candle by candle
Replay each session one candle at a time and take every valid signal, including the ones that look ugly. Skipping signals you "wouldn't have taken" is the most common way manual backtests lie.
Step 4: log every trade in R
| Field | Example |
|---|---|
| Session and time | Session 14, 9:52 |
| Direction | Long |
| Entry, stop, target | 18,240 / 18,225 / 18,270 |
| Result | +2R |
| Rule followed? | Yes |
| Note | Entered on the second candle, not the first |
R is the risk on the trade: a full stop is -1R, a target at twice the risk is +2R. See risk reward and win rate.
Step 5: read the results honestly
Look at more than the total:
- Win rate and average win and loss in R, and the expectancy they give.
- Fees: subtract them. Tight stops make them matter.
- Worst losing streak and deepest drawdown, in R and in dollars at your size.
- Consistency: does the edge show up in most months, or does one great week carry it?
- Prop firm rules: would a losing streak like your worst one end a $50,000 evaluation at your size?
Step 6: change one thing at a time
If you want to improve the strategy, change one rule, run the same sample again and compare. The TJR backtest video above works this way: it builds a well known strategy up rule by rule on years of NQ history, then changes a single setting, the chart timeframe, and checks the settings next to the best one as well. Testing many changes at once tells you nothing about which one mattered, and picking the best of many versions on the same data flatters the result, so say which version you picked after seeing the results.
Manual and automated backtesting together
Manual replay is best for rules that need judgment and for learning to execute them. Code the rules that can be coded and run them over far more history. In ChartTrainer you can do both: replay sessions candle by candle with the date hidden for manual testing, and run scripts in a Pine Script style language through the backtester, which reports the trades, the equity curve and your odds of passing an evaluation. Start from the futures simulator.
Videos
Questions
- How many trades do I need to backtest a strategy?
- More than most people think. With 20 or 30 trades, luck can easily decide the result. Aim for at least 100 trades across different market conditions before you trust a win rate or an average.
- What is the difference between manual and automated backtesting?
- In manual backtesting you step through past charts and take trades by your rules yourself. In automated backtesting the rules are coded and run over the history in seconds. Manual testing works for rules that need judgment; automated testing gives far bigger samples.
- What should I record for each backtest trade?
- Date and time, direction, entry, stop, target, exit, result in R, the setup name, and whether you followed every rule. Results in R make trades of different sizes comparable.
- Why do backtests look better than live trading?
- Hindsight, picked examples, ignored costs and rules that change during the test. Hiding the date, taking every valid signal, counting fees and freezing the rules before the test removes most of it.