How to Backtest a Trading Strategy by Hand, Step by Step
A rules-first procedure for backtesting by hand: what to write down, how to hide the future, what to log for each trade, and a finished log with its sums.
3 Nov 2026 · 6 min read
To backtest by hand, write your entry and exit rules down first, then move through old price data one bar at a time, record every trade those rules would have taken, and work out the result from your log. The order matters more than the tool: rules before you look, every setup logged, costs included, and the sums done at the end rather than as you go.
The steps
- Write the rules as sentences someone else could follow. What counts as an entry, where the stop goes, where the trade closes, and how big it is. If a rule needs the words “it looks like”, it is not a rule yet, and you will bend it differently every time. Entry rules that cannot be written down cannot be tested by hand either.
- Choose the sample before you look at it. One market, one timeframe, and a stretch of history that contains more than one kind of conditions: a trend, a range, a quiet spell, a fast one. Write the dates down. Choosing the period after seeing how it turned out is the oldest way to fool yourself.
- Hide the future. Cover the chart to the right of the bar you are on, or use a replay tool that reveals one bar at a time (compared here). You are deciding with what was visible then, not with what you now know.
- Move forward one bar at a time and log every setup that meets your rules. Take the ones the rules take, including the ones you would have been nervous about. If you skip one, log that you skipped it and why; a log that only holds the trades you liked is not a test of the rules.
- Record the same fields for every trade: date and time, side, entry, stop, exit, the result in R (money won or lost divided by the money risked), and the cost. See R-multiples if 1R is new to you.
- Put in the costs. Subtract the spread, and commission if your account charges one, from every trade, in R. Old charts do not carry your broker's spread for you, so you enter it. See backtesting mistakes for how much this alone moves a result.
- Do the sums last. Number of trades, win rate, average win, average loss, expectancy, the longest run of losers and the deepest dip (maximum drawdown), all from the finished log.
- Keep some of the history back. Settle your rules on one part of the sample, then run them once on the part you did not use. If you change the rules after that, the second part is spent and you need a new one.
What the log looks like
Below is a finished log of ten trades. These are made-up inputs to show the format and the arithmetic, not anyone's results. The cost is set at 0.10R per trade for every row.
| Trade | Side | Result before cost | Cost | Result after cost | Running total |
|---|---|---|---|---|---|
| 1 | Long | +2.00R | −0.10R | +1.90R | +1.90R |
| 2 | Long | −1.00R | −0.10R | −1.10R | +0.80R |
| 3 | Short | −1.00R | −0.10R | −1.10R | −0.30R |
| 4 | Long | +1.50R | −0.10R | +1.40R | +1.10R |
| 5 | Short | −1.00R | −0.10R | −1.10R | 0.00R |
| 6 | Short | +2.00R | −0.10R | +1.90R | +1.90R |
| 7 | Long | −1.00R | −0.10R | −1.10R | +0.80R |
| 8 | Long | −1.00R | −0.10R | −1.10R | −0.30R |
| 9 | Short | +2.50R | −0.10R | +2.40R | +2.10R |
| 10 | Long | −1.00R | −0.10R | −1.10R | +1.00R |
- Trades and win rate: 10 trades, 4 of them winners after cost, so 40%.
- Average win and average loss: +1.90R and −1.10R.
- Total: +2.00R before cost and +1.00R after 10 × 0.10R of cost, which is +0.10R per trade.
- Longest losing run: 2 trades in a row. Deepest dip: 2.20R from the highest running total to the lowest after it.
Notice what the cost did: it halved the average result per trade, from +0.20R to +0.10R. And notice how little ten trades say. One more loser at the end changes the sign of the whole sample's total. How many trades are enough is its own question, answered in how many trades before your stats mean anything; for now, treat a small log as a first look and keep logging.
Where a by-hand test goes wrong
- Peeking. A glance at the next candle, or at where the move ended up, quietly changes which setups you take. This is why step three exists.
- Bars hide what happened inside them. If one bar's range reaches both your stop and your target, the bar cannot tell you which came first. Bar replay against tick data works through an example.
- Fitting the rules to the sample. Every time you adjust a rule after seeing the results, the sample is teaching the rules instead of testing them. The list is longer in backtesting mistakes.
- Doing it by hand at all. It is slow, and it tests the rules as you read them, not as a program would. Manual against automated testing sets out what each can and cannot see.
After the backtest
A backtest shows how a set of rules behaved on old data. It does not show how you will behave, or how the next stretch of the market will treat the same rules. The usual next step is to run the rules forward, in real time, on a demo account, with the number of trades and the pass line written down in advance; see backtest, forward test and demo.
Trepeat does not sell a backtesting or replay tool today.
We're working on a free journal and a backtester, with no date yet. Today Trepeat is a trade copier for MT4, MT5 and cTrader, currently on demo accounts, and you can add notes, a grade and screenshots to any copied trade once it closes, with a calendar of your results.
How the journal works. The lot size calculator turns a stop distance into the position size that makes 1R the amount you meant it to be, and the backtest log template does the sums on a log like the one above.
Written by the Trepeat team.