Backtesting means running your strategy's rules on past market data to see what result you would have gotten if you had done exactly the same things at the time.
And that is where the first misunderstanding starts: a backtest is not there to prove your strategy is good. It is there to give it a fair chance to fail, cheaply, before you spend real money on it. If you go into a backtest looking for proof, you will always find something that seems to work, and then you will lose in the live market.
Before you backtest: the rules must be executable
Until you can write your strategy down so clearly that someone else could read it and take exactly the same trades, your backtest means nothing. "I buy when the market looks strong" cannot be tested, because on a past chart you will see "looking strong" exactly where you already know price went up.
A rule needs four things: an entry condition, an exit condition, where the stop loss goes, and how position size is set. If you do not have those four yet, start with the academy, then backtest.
Three errors that turn the result into fiction
One: looking into the future
The most dangerous and the hardest to notice. When you look at a past chart, everything that came next is right in front of you, and your mind uses it without you meaning to. Traders call this look-ahead bias. It gives you entries you would never have taken in the moment.
The practical fix: hide everything to the right of the current candle and move forward one candle at a time, or use a replay tool that does it for you. If you are scrolling back and forth and picking trades, you are writing a memoir, not running a backtest.
Two: leaving out costs
Spread, commission and swap do not show up on the chart, but they do show up in the account. On strategies with a tight stop loss, those costs alone can turn a positive expectancy negative. Use your own broker's real numbers, not an optimistic guess. The real cost of every trade walks through that calculation.
Three: optimizing on the same data
If you keep adjusting the parameters until they give the best result on this exact period, you have built something that has only memorized this period. This is called overfitting, or curve fitting. The telltale sign: a small change in one parameter changes the result dramatically.
The fix: set one part of the data aside and do not look at it at all. Build the strategy on the rest, and at the very end test it once on that untouched part (traders call it out-of-sample data). If it holds up there too, you actually have something.
How to backtest a trading strategy, step by step
- Write the rules down and keep them next to you. If you change them in the middle of the test, start the test over.
- Choose a deliberately varied period: trending, ranging, and a stretch where you know your strategy struggles.
- Move forward one candle at a time and decide each trade without seeing what comes next.
- Log every trade with the date, the reason for entry, where the stop loss was, and the result in R.
- At the end, calculate the average R, not the total profit. Win rate vs expectancy explains why this is the deciding number.
- Write down the worst losing streak. That number tells you how much you will have to sit through in the live market, and it ties directly to how you choose your position size.
A good backtest is not the finish line
A backtest only tells you the strategy would have worked in the past, under your assumptions. The live market adds three things no backtest shows: slippage in execution, how the market behaves around major news, and, more important than both, your own behavior. That is why the next step is trading live at the smallest possible size, not full size. This is called forward testing.
And because the hardest variable is you, the journal you opened for the backtest should stay open for your live trades too. Why a trading journal matters more than any indicator and our trading journal cover exactly that.
A backtest that has never rejected a single strategy is not a measuring tool; it is a mirror that shows you whatever you want to see.
Summary
Backtesting is the cheapest way to throw out strategies that do not work. Its value depends on doing it with the intent to reject: without seeing the future, with real costs included, and without tuning parameters until the number looks pretty.
If you want to see how this stage fits into the bigger path, how long it takes to learn trading and the roadmap show you where it sits: a backtest is the checkpoint that closes the rule-building stage, nothing more and nothing less.


