What you should know about backtesting trading strategies

Did you know that traders and climate change scientists use the same technique? In trading, it’s called backtesting; in climate modeling, it’s called hindcasting. Some scientists are even using bee and pollen samples from 1910 to predict the future of urbanization and agricultural land conversion. Who would’ve guessed that a UC Berkeley professor saying that hindcasting (equivalent to backtesting) is “the only way to test a model and improve forecasting” could be applied to trading? 

Momentum trading: explanation & strategies for beginners

Let’s cast bees aside and explore the basics of backtesting in the trading context. 

What is backtesting?

Backtesting is a method of assessing the viability of a strategy using historical data. It allows you to see how a trading strategy would have performed over a certain period in the past, ultimately indicating how it might perform in the future. 

If you have a hypothesis for a trade set-up, you can implement it in a simulated trading environment. If it gives good returns, you’ll become more confident about introducing this strategy into your trading toolkit. 

Prerequisites for backtesting

You’ll need to make up your mind about several prior conditions.

1. Trading logic

What are you going to test, and what are you going to do with the results? For example, you need to find similar market conditions on the historical price chart. The timeframe depends on your trading approach. The more times the strategy confirms its effectiveness, the better it is. If the results are negative, you should ditch the strategy.

2. Market and asset

Select the right market and asset class to trade in. Here, the “right” choice means the one that makes sense for your trading style, plan, risk tolerance, goals, and skills.

3. Data

It’s important to get high-quality data, which can be accessed directly in the backtesting software or, alternatively, from a data vendor or a broker. With poor-quality data, the output analysis will be incorrect and misleading.

4. Programming language

Best trading strategies in fixed time trades

If you want to learn how to backtest trading strategies with an algorithm, it’ll require some coding knowledge. It can be Python, C++, MatLab, or R.

The importance of backtesting trading strategies

When traders find or build a promising strategy, they often can’t wait to use it in live markets. But you’ll save yourself a lot of pain and frustration if you just test it first.

Suppose you have a good strategy on paper. As you run tests on it, you’ll be able to detect any technical or theoretical flaws and, most importantly, optimize and improve it until it performs how you want. It’s better to test standard strategies that are used by many other traders, too, so that you can adapt them to your trading approach and your chosen asset.

Of course, it doesn’t mean that it’ll perform the same in the future. But markets tend to move in circles, and it’s very common to see historical patterns repeat themselves. Besides, for traders, having the right mindset and confidence in their strategy is an important element of trading psychology.

What do you think you know about trading
Are you sure you’re correctly evaluating your knowledge in trading? Are you ready to move forward or should you upgrade your skills? Try this quick test!
Start test

The biggest backtesting mistakes you can make

If you make any of the mistakes below, you won’t get accurate data: 

Indicator and strategy: what’s the difference?
  • Testing too little: Even if a strategy has an edge in a short period of a month, what about the rest of the time? Get confirmations at various timeframes — at least 5 potential trades in the past.
  • Making adjustments in the middle of the test: Whatever tweaks you want to make can wait. It’s important to test each strategy separately and have complete data for evaluation.
  • Overfitting and overoptimizing: You don’t need to aim for an insanely high quote rate like 90% and up. You still won’t be able to catch perfect entries every time, but you risk getting too fixated on individual trades rather than the long-term perspective. 


It’s easy to imprint your own biases into trading. So, use backtesting as a way to remain impartial and reasonable about your choice of trading strategies.

Disclaimer: No strategy can guarantee 100% correct outcome of the trade.

Copy link
Link copied
Press Go and let the wheel choose your article of the day!
How to trade the 15-minute chart successfully
4 min
Market reversals and the sushi roll technique
5 min
Top 5 short-term trading strategies that pros use
5 min
What are the best trading strategies for cryptocurrency?
5 min
How to master divergence trading – the complete guide
3 min
Fading trading strategy: a complete guide

Open this page in another app?

Cancel Open