Backtesting

How to backtest a trading strategy, step by step

A plain walkthrough of manual backtesting. Write the rules down, pick the data, replay it bar by bar, record every trade, then read the result honestly.

Updated 25 August 2026

This is the process, start to finish, for testing a strategy by hand. It works whether you use a replay tool or a spreadsheet and a chart. The order matters more than the tools.

Step 1. Write the rules down before you look at anything

If your rules are not written down, you do not have a strategy. You have a habit that changes shape depending on what the chart is doing.

Write down four things. What has to be true for you to enter. Where the stop goes. Where you take profit. How much you risk. Be specific enough that another person could follow it without asking you a question.

Step 2. Pick your market and your period

Test one market at a time. A strategy that works on gold and fails on the euro is telling you something, and you lose that signal if you mix them.

How much history you need depends on how often you trade. New Trading suggest "3–6 months of intraday data (1-minute or tick charts)" for day trading, "3–5 years to capture different market conditions" for swing trading, and "at least 10 years to account for multiple market cycles" for long term trading [2].

Whatever you pick, it needs to include more than one kind of market. A test that only covers a calm uptrend tells you how your strategy does in calm uptrends.

Step 3. Replay it forward, not backward

This is the part people get wrong most often. If you scroll a chart and look for your setup, you already know what happened next. Your eye finds the ones that worked.

You have to hide the future. Move forward one bar at a time and make the decision with only the information you would have had at the time. If you would not have seen it live, you cannot count it.

This is the whole reason replay tools exist. Everything to the right of the current bar is covered up, so you cannot cheat by accident.

Step 4. Take every single signal

Every trade your rules produce goes in the record, including the ones you would have talked yourself out of, and especially the ones that lost badly.

The moment you start skipping trades because they felt wrong, you are testing your mood rather than your strategy. If your judgement really is part of the edge, then write down what the judgement rule is and test that instead.

Step 5. Record the same things every time

For each trade write down the date and time, the direction, the entry, the stop, the target, the exit, and the result in R.

R means the size of your risk on that trade. If you risked 200 and made 400, that is plus 2R. Using R instead of cash lets you compare trades of different sizes and lets you compare your record to anyone else's.

Add a note about why you took it. Six weeks later that note is the most valuable column in the sheet.

Step 6. Keep going until you have enough

Ten trades tell you nothing. Thirty tell you very little. FTMO put the bar at "a sample size of at least 100-200 trades" before you can be confident a system is stable [1].

This is slow and it is meant to be. If you can reach two hundred trades in an afternoon of replay, you have almost certainly been scrolling rather than replaying.

Step 7. Read the result honestly

Look at four numbers. Your average result in R. How often you win. Your worst run of losses in a row. Your deepest drop from a high point.

The last two matter more than people expect, because those are the numbers that decide whether you can actually trade the thing. A strategy with a great average that goes through eleven losers in a row is only tradeable if you knew that was coming.

Then hold some data back and test on that, without changing anything. If the result falls apart, what you found was a pattern in the noise.

Sources

  1. FTMO Academy, "How to Backtest Trading Strategies". https://academy.ftmo.com/lesson/how-to-backtest-trading-strategies/
  2. New Trading, "How To Backtest A Trading Strategy: A Step-by-Step Guide". https://www.newtrading.io/backtesting-guide/

Test it on what actually happened

Replay any market from any date and find out whether the thing you believe about your trading is true.

Start free