Last Updated on 13 April, 2021 by Samuelsson
Nowadays, there are many programs and trading platforms out there which allow you to backtest your strategy. However, you might not have these programs available at all times, or you might want to see the intricacies of your strategy in action. The good news is that it is possible for you to backtest your strategy on your own. All you need in order to do this is your trading strategy and past data.
Backtesting a strategy is not that difficult even if you do it manually. That said, it is much easier to do it while using a program or a platform. The one thing that you need to be careful about is curve fitting, which could be the difference between you earning amazing returns and completely wiping out your capital.
What is Backtesting?
Backtesting is the bread and butter of creating trading strategies and edges. During a backtest, a new strategy is run through past data to ascertain its effectiveness. This has a lot of advantages such as being able to see the strategy in action as well as determining whether or not you need to change some of the parameters in order to see it work.
If backtesting yields good results for a trader, they might have confidence in the strategy. If a backtest does not yield acceptable returns, then it will probably require changes. It is possible that the entire strategy that you came up with is not worth pursuing.
While backtesting is a great idea, you need to be very careful when backtesting. As we explain later on, it is quite possible that a strategy which worked incredibly well during the backtest would not work on real-time data. Still, there are ways to mitigate this problem.
How to Manually Backtest Your Strategy
Generally, backtesting is done by people who have knowledge of coding. Those who do not know how to code end up using a backtesting platform. If you do not want to backtest manually, then you can take a look at some of the best free stock simulators (insert link), most of which allow you to backtest your strategy with relative ease.
If you do end up wanting to manually test your strategy, then you can simply use any chart which allows you access to the indicators necessary for your strategy. The best free options currently available at TradingView and MT4/MT5. Now, let’s take a look at how to manually backtest your strategy.
1.Formulate the Strategy
Before you can backtest your strategy, you need to make sure you have a strategy. It is imperative that you do not test half-hearted attempts as that is bound to be a waste of your time,
Formulate your strategy based on your trading knowledge. Once you are finished, take a long, hard look at it and try to analyze each individual parameter. If something does not seem right, then alter it before you move on to backtesting. Things to be aware of are your entry/exit signals, conditions, timeframe, and risk per trade.
Once your strategy is complete, you can move on to backtesting.
2. Select a Market and Set up Your Chart
Select the market that you want to backtest your data in. Once you have the market, open the chart that you are using and select a timeframe from the past.
Usually, traders backtest their strategy for at least a few years. While some traders think that you should scroll back to the beginning of the chart, that is not necessary. As long as you are able to backtest your strategy for an extended length of time, you should be fine. Around 10 years provides plenty of history to form a good sample size.
After that, use the tools available in your chart to bring up all the indicators that you need for your trades. Make sure your chart is properly set up with all of the trading tools that will be required during the backtest. Now, you are ready to begin your backtest.
3. Manually Backtest Your Strategy
You may already have figured out what to do next! Move the chart forward bar by bar and begin to backtest your strategy. This involves recording trades whenever your trading strategy advises you to.
Recording your trades is actually quite easy, and can be done on either an actual journal or a program like Microsoft Excel.
Journaling your trades is not very difficult, but it can be quite tedious. All you need to do when a trade signal is generated is to record the entry point, stop-loss, date and time, and any other information that could apply to the trade. What many traders like to do is to also mention other tidbits that their trading strategy is telling them such as risk to reward ratio, etc.
Once you are ready to bow out of the trade, remember to note down your return as well as the exit point. After that, you simply need to repeat the process. As you might be able to tell, backtesting can be quite boring and take a lot of time. Remember that if you backtest a decade of data, you will probably end up taking at least a few hours. As such, make sure you have the time before you sit down to backtest a strategy.
Negatives of Manual Backtesting
The problem with backtesting manually is that you can make mistakes when tracking the data. On top of that, there is also a psychological component involved when backtesting your strategy. Since you are able to see the data ahead, you might not end up making trades that your strategy signals you to.
Usually, people try to justify this with the phrase ‘I won’t have made that trade in real life’.
Just don’t do this! If a trade meets your criteria, then record it!
Want a Quicker Solution?
Then we recommend that you start to learn an easy coding language, like Easylanguage. It will let you backtest an idea in minutes instead of hours, and take your trading to the next level.
Want to know more about Easylanguage? Then please have a look at our article about Easylanguage and its benefits!
The Pitfalls of Backtesting (Curve Fitting)
Curve Fitting is by far the most annoying thing when coming up with a new strategy, and is something we wan to try to avoid by all means!
Simply put, curve fitting is when a strategy works well during backtesting but does not perform in the markets. This is usually due to market noise forming random patterns in the price data. Traders often think of these patterns as proof that their strategy works. However, these patterns are completely random and traders often end up losing a fair bit of their capital before they realize that their strategy is flawed.
How to Avoid Curve Fitting
Although it is impossible to completely be sure that there was no curve fitting during your backtest, there are ways to reduce its chances. Here are a few of them.
- Backtest your strategy across multiple markets. If a strategy works well on several markets, that a sign of robustness.
- Your strategy should generate enough signals during your backtest to provide you with a reasonable number of trades. If you have a strategy that generates very few trading signals, then multiple backtests (or backtests of a longer period) will be needed in order to reduce the threat of curve fitting
- The simpler your strategy, the easier it will be to work out what’s wrong with it
- Look for stable parameters (A good strategy should work with multiple values surrounding your parameter of indicators e.g a strategy that works with RSI set to cross over 40 should work at 35 and 45 as well)
If you want to know more about curve fitting, check out Robust Trader’s complete guide to Curve Fitting and how it is possible for it to end your trading career.
Manually backtesting a strategy can be tedious, but it is also worth it. With it, you can see your strategy play out over a number of years and figure out where it is flawed. On top of that, the actual process of backtesting is incredibly simple and can be done by anyone.
Remember to check all of your strategies for curve fitting and do all that you can to mitigate it. It is much better to lose money when backtesting than it is to lose real money trading on the markets.
And if you don’t want to do it manually, there are far better and quicker solutions, like Easylanguage!
Here you can read more about algotrading in our archives.