What is backtesting?
Backtesting means running a trading strategy over past prices to see what it would have done. It is the cheapest way to find out that an idea does not work, which is the most useful thing it does.
How backtesting works
A strategy has to be written as exact rules first: when to enter, when to exit, and what it costs. The test then steps through history one candle at a time. At each candle it asks whether your rules are met, using only what was known at that moment, and records the trades that would have followed.
At the end you have a list of trades and the figures that summarise them: how many there were, how large the wins and losses were, and the deepest fall along the way.
What a backtest can tell you
- Whether your rules do what you think they do, which is often a surprise
- How often the setup really occurs
- How the strategy behaved through different market conditions
- What a losing streak looked like, so it does not shock you later
- How much of the result survives your costs
What it cannot tell you
A backtest is evidence about the past. Markets change, and a good result does not mean the next year will look the same. It also leaves out things that are hard to replay, including how you would have felt during a drawdown and whether you would have kept following the rules.
The mistakes that flatter a backtest
- Too few trades. Nine good trades are an anecdote. Read the trade count before anything else.
- Leaving out costs. The gap between before and after costs is where many strategies live.
- Lookahead. Using information that was not available at the time, even by one candle.
- A short or friendly window. A trend strategy tested only on a rising year proves little.
- Over-fitting. Tuning the settings until the past looks perfect. Here is how to spot it.
Backtesting and forward testing
A backtest looks at the past. Forward testing watches the same rules on live prices, without risking money, to see whether they behave as the test suggested. They answer different questions and work well together: in SixOne8 you can test a strategy, then add it to a watchlist and see the alerts it would produce as they happen.
The short version
Treat a good backtest as a reason to keep investigating, not as a forecast. Backtested results do not indicate future results.
Try this in SixOne8
Build a strategy and test it on years of real prices. Free to start, no card.