Skip to main content

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.

TradeSideResult before costCostResult after costRunning total
1Long+2.00R−0.10R+1.90R+1.90R
2Long−1.00R−0.10R−1.10R+0.80R
3Short−1.00R−0.10R−1.10R−0.30R
4Long+1.50R−0.10R+1.40R+1.10R
5Short−1.00R−0.10R−1.10R0.00R
6Short+2.00R−0.10R+1.90R+1.90R
7Long−1.00R−0.10R−1.10R+0.80R
8Long−1.00R−0.10R−1.10R−0.30R
9Short+2.50R−0.10R+2.40R+2.10R
10Long−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.

How to Backtest a Trading Strategy by Hand, Step by Step — common questions

How many trades do I need in a backtest?

There is no fixed number. A few dozen trades give a first look that one more result can overturn, so keep logging and recompute on a fixed window to see whether the figure holds.

Should I include the spread?

Yes. Subtract the spread, and commission if your account charges one, from every trade in R. Old charts do not carry your broker's spread, so you enter it yourself.

What is the difference between backtesting and forward testing?

A backtest uses data that already exists; a forward test runs the same fixed rules on data that arrives afterwards. The forward test is the check that you did not shape the rules to the old data.

Does Trepeat have a backtesting tool?

Not today. We are working on a free journal and a backtester, with no date yet. Trepeat currently offers a trade copier for MT4, MT5 and cTrader on demo accounts, with a journal of the copied trades.

All questions — pricing, the trial, copying and safety — are in the Help Centre. Still stuck? Email support@trepeat.com.

Related guides

More guides

Trade once. Repeat everywhere.

Free trial on cTrader1 week · up to 3 accounts · no card

MT4 and MT5 connect as soon as you subscribe.