Skip to content
GUIDE · BACKTESTING

How to backtest a trading strategy without fooling yourself

Backtesting means running a strategy’s rules on historical data to see what would have happened. It’s the cheapest way to throw out bad ideas, and also the easiest way to fool yourself.

Last updated: 11/06/2026 · 7 min read

What is backtesting?

A backtest takes a strategy with clear rules (“buy when…”, “sell when…”) and applies them candle by candle to the price history, as if it were trading at that moment. The result is a list of trades and a set of metrics: how much it would have made or lost, how deep the drops were and how often it traded.

It only works with strategies defined as rules. If a strategy relies on “gut feeling”, it can’t be tested, which is why turning it into a bot first is so useful.

How to backtest step by step

  1. Define closed rules: entry, exit, position size and stop. No “it depends”.
  2. Pick the period: long and varied. In crypto, include at least one big rally and one big crash.
  3. Set realistic costs: fees per trade and slippage (the price you actually get filled at).
  4. Run it and read the metrics (the ones that matter are below).
  5. Validate out of sample: keep a stretch of data you didn’t use for tuning and check the strategy holds up there.
  6. Paper trade it before using real money.

The metrics that matter

MetricWhat it tells youRed flag
Total returnWhat it would have made over the periodFar better than the asset itself, with no explanation
Max drawdownThe largest drop from a peakMore than you could stomach
Number of tradesWhether the sample is big enoughFewer than 30–50: could be luck
Win rateHow many trades winRead without average win/loss size
Profit factorGross profit / gross lossBelow 1.2 after costs
Sharpe ratioReturn per unit of volatilityVery high values with few trades

Always compare against the simplest alternative: buy and hold the same asset. If your strategy doesn’t beat it after costs, with smaller drawdowns, it may not be worth it.

The mistakes that inflate results

Overfitting

Tuning parameters until the past looks perfect. The strategy ends up “memorising” the history and fails on new data. Few parameters, round values and out-of-sample validation are the best defence.

Look-ahead bias

Using information that didn’t exist yet, such as the close of a candle that hadn’t finished. A good backtesting engine only evaluates closed candles.

Ignoring costs

Fees, slippage and, for futures, funding. For strategies that trade a lot, costs decide whether you win or lose.

A period that is too short or too friendly

A backtest run only during a bull market says little. Test across different market regimes.

Backtesting in Bot Shaper

  • Quick backtest in the chat: when you create a bot, Shaper tests it and shows you the key numbers.
  • Backtesting Lab for longer runs, on real Kraken and Binance history with configurable fees and slippage.
  • Every backtest is saved with the bot version it ran on, so you can compare changes.
  • Then the bot moves to the practice account with live prices to validate it in the present.

You can start from one of the strategy templates and run its backtest without setting anything up.

FAQ

Does a good backtest guarantee profits?

No. A backtest shows how a strategy would have performed in the past. You need it to rule out bad ideas, but it doesn’t guarantee future results.

How much data do I need for a reliable backtest?

Enough for dozens of trades and several types of market. In crypto, one or two years of hourly or 4-hour candles is a good starting point.

Where can I backtest for free?

Several tools have a free tier. In Bot Shaper you can run backtests with the 1,000 free credits you get at sign-up, no card required, on real Kraken and Binance data.

Templates to start with

Keep reading

How to Backtest a Trading Strategy (Without Fooling Yourself)