Guide

How to backtest a trading strategy, step by step

Backtesting means trading your strategy on past charts as if it were live, to find out whether it makes money before you risk any. This guide shows how to do it properly, which numbers matter and which mistakes make a backtest look better than it is.

Updated on December 6, 2026 by the nuchtr team.

In short

  • Write your rules down before you look at a single chart, and do not change them during the test.
  • Go through the chart one candle at a time and log every trade your rules give, also the ones that go wrong.
  • Aim for at least 100 trades per setup, spread over different market conditions.
  • Judge the strategy on its expectancy in R, its largest drawdown and its longest losing streak, not on the win rate alone.
  • Test a second period you have not looked at before you trade it live.

What backtesting is

Backtesting is testing a trading strategy on past market data. You go back in time on the chart, apply your rules exactly as you would live, and write down every trade and its result. After enough trades you know how the strategy did: how often it won, how much it made per trade and how deep the losing runs got.

There are two kinds. Automated backtesting runs a strategy written in code over years of data in seconds. Manual backtesting means you replay the chart yourself and decide every trade by hand. Most discretionary traders backtest by hand, because their rules include things a script cannot easily see, such as how clean a level is. This guide is about manual backtesting.

Before you start: write your rules

A backtest only means something if the rules are fixed before you begin. Write them down so clearly that another trader could take the same trades from them.

  • Market and timeframe. Which instrument, and on which chart you look for entries.
  • Entry. The exact moment you get in, for example the close of a candle above the high of the London session range.
  • Stop. Where your stop goes and why, for example below the low of that range.
  • Target and exit. A fixed target such as 2R, a trailing stop, or an exit at the end of the session.
  • Risk per trade. A fixed amount or percentage, so every trade can be compared in R.
  • When you do not trade. Around news, in certain sessions, or after a maximum number of trades per day.

How to backtest, step by step

  1. Pick the market and the period. Start with the market you want to trade. Choose a period of several months with both trending and ranging markets.
  2. Hide the future. Go to the start date and make sure you cannot see the candles that come after it. A replay mode does this for you.
  3. Move forward one candle at a time. Decide on the close of each candle, exactly as you would live.
  4. Log every trade the moment you take it. Date, setup, entry, stop, target, exit, result in R, whether you followed your rules, and a screenshot. The free backtesting template has a column for each.
  5. Take every trade your rules give. Also the ones that look bad. Skipping trades is the fastest way to fool yourself.
  6. Keep going to at least 100 trades per setup. Then stop and read the results.
  7. Test a second period. Run the same rules on a period you have not looked at yet. If the results hold up, forward test on a demo or at a small size.

Which numbers to look at

The win rate is the number everyone looks at first, and on its own it says the least. A 35% win rate makes money with winners of 2R, and a 70% win rate loses money when the losers are three times the size of the winners. Look at these together:

  • Expectancy in R. Your average result per trade. Above 0 the strategy made money in the test, and this is the number that counts. The expectancy calculator works it out from your win rate and your average win and loss.
  • Win rate with your average win and loss. To break even you need a win rate of 1 divided by (1 + your risk reward). At 2R that is 33.3%, at 1R it is 50%.
  • Profit factor. Everything you won divided by everything you lost. Above 1 you made money.
  • Largest drawdown and longest losing streak, in R. Ask yourself whether you could sit through them with real money. The Monte Carlo simulator shows how deep the losing runs can get with the same numbers.
  • Results per setup and per session. Often one setup or one session carries the whole result, and the rest only costs money.

How many trades you need

With 20 or 30 trades a few lucky winners decide the result. From around 100 trades per setup the win rate and expectancy start to settle, and with a low win rate you need more. The expectancy calculator works out how many trades your own numbers need before the result is more than luck.

Spread the trades over different market conditions as well. A trend strategy that is only tested in a strong trend looks much better than it is.

Mistakes that make a backtest look better than it is

  • Looking ahead. Seeing the next candles before you decide. Even a glance changes your decisions.
  • Skipping trades. Leaving out the setups that did not feel right, which are often the ones that lost.
  • Changing the rules until the result looks good. This is called curve fitting. Rules tuned to one stretch of data rarely work on the next. Every change is a new test.
  • Too little data. One month, one market, one kind of market condition.
  • Forgetting costs. Spread, commission and slippage weigh heavily on small targets.
  • Moving your stop or target afterwards. In a backtest it costs nothing. Live it does.
  • Testing what you cannot do live. Entries that need you at the screen at three in the night, or a speed you cannot keep up.

Spreadsheet, TradingView or backtesting software

You can backtest with a chart and a spreadsheet. It costs nothing, but you move the chart in one window and type the prices in the other, and that is slow. The free backtesting template does the sums for you.

TradingView has Bar Replay, which works well on the charts you already use. How much intraday history you get depends on your plan, and your results are not kept for you, so you still need a spreadsheet next to it.

Backtesting software replays the chart and logs a trade the moment you place it, with your statistics per session. See the best backtesting software for what the main tools offer for the price.

Backtesting a prop firm challenge

A strategy that makes money can still fail a challenge. The daily loss limit, the maximum loss and a consistency rule can end the account before a good strategy has time to show its edge. So test the strategy with the rules of the program, not only on its own.

In nuchtr you pick the prop firm and the program, and the backtest uses its rules, phases and fee, up to requesting the payout. The free prop firm calculator shows your chance to pass with your own win rate and risk, and the prop firm rules list the rules of every program.

From backtest to live

A good backtest is the start, not the proof. Trade the strategy on a demo or at a small size first and keep a journal, so you can compare your live results with the test. If they differ a lot, the cause is usually in the execution, not in the strategy.

In nuchtr your synced live trades also go into the backtest with the outcome hidden, so you can check whether you would still take them. For numbers from many traders at once, see the trading statistics.

Once a setup holds up, write its rules into your trading plan, together with your risk per trade and your loss limits. The free trading plan template has an example to start from.

Questions

How do you backtest a trading strategy?

Write down your rules, go to a period in the past and move through the chart one candle at a time without looking ahead. Log every trade your rules give with its entry, stop, exit and result in R. After at least 100 trades, look at your expectancy, drawdown and losing streak, then test a second period.

How many trades do you need for a backtest?

At least 100 trades per setup, and more if your win rate is low. With fewer trades a handful of results can decide the outcome.

Is manual backtesting better than automated backtesting?

They answer different questions. Automated backtesting tests a coded strategy over many years of data quickly. Manual backtesting tests a discretionary strategy the way you would really trade it, one decision at a time.

What is a good win rate in a backtest?

It depends on your risk reward. To break even you need a win rate of 1 divided by (1 + risk reward), so 33.3% at 2R and 50% at 1R. Look at the expectancy in R to see whether the strategy makes money.

Can you backtest on TradingView?

Yes, with Bar Replay. How much intraday history you get depends on your plan, and you log the results yourself, for example in a spreadsheet.

Backtest in nuchtr.

nuchtr replays the chart candle by candle, logs every trade you place and keeps the statistics per session. You can also test a prop firm challenge with the real rules of the program.

Start nuchtr7 days free, then €24.75 excl. VAT every 30 days, every feature and connection included. Cancel any time.