How To Backtest A Trading Strategy
Backtesting assesses the viability of a trading strategy or pricing model by discovering how it would have played out retrospectively using historical data.
Go Back
π 6:23 PM
π
May 19, 2025
βοΈ By Ecojames
What is backtesting?
Backtesting is a way of analysing the potential performance of a trading strategy by applying it to sets of real-world, historical data. The results of the test will help you lead with one strategy over another to get the best outcome.
How to back-test a strategy
- Simply navigate to the indicators and trading systems window.
- Select the trading system you want to backtest.
- Open the trading system and input your test parameters.
-Run your test and analyse the results.
- If your trading system generates three trades per day, i.e. 500 trades per year, then a year of testing gives you enough data to make reliable assumptions.
- But if your trading system generates only three trades per month, i.e. 36 trades per year, then you should backtest a couple of years to receive reliable data.
- For strategies with an average holding period from 1 day to 30 days, 2 to 3 years is a pretty good rule of thumb. You should follow that up with 3 to 6 months of paper trading.
- Longer holding periods, more backtesting time. There is no 100% win strategy in trading, as losses are inherent to trading and ensure market diversity and competition.
Popular trading strategies include trend trading, position trading, range trading, swing trading, scalping, day trading, carry trade, and news trading.
- Trend trading is one of the most reliable and simple trading strategies. As the name suggests, this type of strategy involves trading in the direction of the current price trend. In order to do so effectively, traders must first identify the overarching trend direction, duration, and strength.
The benefits of backtesting
1. You can test various, even very different trading strategies very quickly and without risking any capital
2. The test, optimise, re-test cycle of backtesting enables continued fine-tuning of any strategy you think could produce favourable results
3. Developing and adjusting strategies that are tailored to your individual preference in terms of risk versus reward
The risks of backtesting
1. Past data isnβt necessarily a good predictor of future market behaviour, so no strategy can guarantee accuracy
2. You may be tempted to refine a model so that it best fits historical data, without accounting for the fact that future conditions may be different
3. Past datasets may be skewed due to an adverse market event or uncharacteristically positive sentiment
4. Insufficient datasets will likely produce models that do not account for a wide variety of market conditions
5. A trading strategy that works well on several datasets from one market may not work well in another market.