Backtesting Strategies

June 10th, 2022

Building strategies for futures trading isn’t easy, but having a great system for backtesting can help. Perhaps you are thinking “okay, easier said than done!” or “sure, but… how?”. Thankfully, there are some general guidelines to follow that will ensure your backtesting is as thorough and helpful as possible. Jacob Amaral, lead at WeTradeLabs, recently hosted a NinjaTrader Ecosystem webinar where he shared some of his own favorite tips and tricks.

The most important principle is to ‘Test Out of Sample’. This means that the timeframe you use to test should be long enough so the test runs through multiple different market regimes. This ensures you can see how the strategy performs in a bull market vs. a bear market, in high volatility vs. low, etc. Amaral said that there is no ‘set in stone’ amount of time that you should use to test your strategies, but it should be as long as possible – certainly long enough to test in multiple market conditions.

Once you have completed this step, it is time to ‘zoom in’ to look at specific timeframes. Amaral gave the example of zooming in on ‘red years’ like 2018 or 2015 to see how the strategy interacts with the market there. Then, look at recent data. Does the strategy work the same? Worse? Better? All of this is useful information. If the results are worse, it’s likely that your strategy is ‘overfit’, meaning it is too closely aligned to a specific batch of data to be widely useful.

Remember, though, that most strategies work better in certain markets than others. It is crucial that you understand which markets your strategy is most suited for. When trading, you then must also understand what market regime you are in so as to determine whether your strategy is a good fit for current conditions. Having this understanding will give you greater confidence in your strategy.

To gain this understanding, you have to ask yourself questions like, “alright, in 2018 when we had a red year, my strategy did well. Why?”. Documenting the answers to questions like this will help you understand the strengths and weaknesses of your strategy and how to best deploy it as part of your own trading.

In this short clip, Amaral explains his backtesting best practices in further detail.

If you are interested in more strategy-building tips, including the rest of Amaral’s list of best practices, be sure to watch his full webinar Better Strategy Building. Then, check out NinjaTrader Ecosystem’s full library of free, on-demand trading webinars and register to attend future live events. New events are added to the schedule on a regular basis, so be sure to check back often!

Enter Email for Updates