ZETEOFree trading journal

Home › Education

How to backtest a trading strategy (without fooling yourself)

Updated: · 4 min read · Zeteo Trades

What backtesting is, manual versus automated backtests, how many trades you need and the common biases that make a strategy look better than it is.

Backtesting means testing a strategy on historical data to see how it would have performed. Done well, it saves you months of real losses: you find out in days whether an idea makes sense. Done badly, it gives you false confidence that the market will correct with real money.

What it is and what it's for

A backtest answers questions like: does this strategy make money in the long run? What's its win rate and risk/reward? What drawdown did it have? How many losses in a row should I expect?

It's also useful for something less obvious: practicing execution. Repeating a setup a hundred times on the chart trains your eye to recognize it in real time.

Manual and automated backtesting

Step by step for a manual backtest

  1. Write down the rules before you start. Entry conditions, stop placement, target or exit method, allowed hours and how many trades per day. If a rule can't be written down, it isn't a rule yet.
  2. Pick the period and the instrument. Include different market conditions: trending days, ranging days and news days.
  3. Hide the future. Use a replay mode that only shows past candles. Looking at the full chart and "finding" entries is the most common mistake.
  4. Log every trade as if it were real: entry, stop, exit, result in R and a screenshot. Use the same fields as in your trading journal.
  5. Don't change the rules halfway. If you think of an improvement, write it down and test it in a new backtest.
  6. Analyze the results: win rate, actual risk/reward, expectancy, profit factor and maximum drawdown.
Candlestick chart with the future hidden, as in a bar-by-bar replay
In a manual backtest you decide with what has already happened; Zeteo Trades' Backtesting section works this way.

How many trades you need

With 20 or 30 trades the result depends too much on chance. As a reference:

If your strategy produces few trades per month, you'll need more historical data to reach a useful sample.

The biases that ruin a backtest

Look-ahead bias. Using information you didn't have at the time: seeing how the candle closed before deciding, or knowing "the market crashed that day". Replay mode largely prevents it.

Overfitting. Tweaking parameters until the historical result looks perfect: "17-period average instead of 20, 13-point stop, Tuesdays and Thursdays only". The strategy ends up describing the past instead of predicting the future. The more parameters you tune, the more you should distrust the result.

Ignoring costs. Commissions and slippage can turn a strategy with many small trades from a winner into a loser. Always include them.

Idealized execution. On a historical chart it looks easy to enter right at the low. Live there's hesitation, delays and orders that don't fill. If your strategy only works with perfect fills, it's fragile.

Cherry-picked samples. Testing only the months that "worked". Choose the period before you start and don't change it.

Validate before risking money

A good practice is to split the data in two: develop and tune the strategy on the first part (in-sample) and test it, without touching anything, on the second (out-of-sample). If the results look alike, that's a good sign. If they collapse in the second part, you probably overfit.

After the backtest, the next step is a forward test: trading the strategy in real time on a demo account or with very small risk, and comparing the results with the backtest in your journal.

What to do with the results

Summary

A good backtest starts with written rules, hides the future, logs every trade honestly, includes costs and collects enough trades. It's the cheapest way to find out whether an idea deserves your money, as long as you don't fool yourself while doing it.

Keep your trading journal for free. Zeteo Trades lets you log every trade, see your P&L on a calendar and get win rate, profit factor and drawdown calculated for you.

Start for free

Keep reading

Educational, general content. Not financial advice or an investment recommendation: trading involves risk of loss.