In this article, we'll talk about how to backtest your trading strategies on the web app Tradewell, a platform specifically designed for traders who want to test their trading ideas without writing code.
While running a backtest on Tradewell is a quick and straightforward process, it’s still important to consider a few things as you evaluate whether your backtested strategy is truly ready for live trading.
Tradewell pulls historical data and helps traders uncover the relationship between two datasets—an input and an output. So as a trader looking to perform a backtest, your first step should be choosing these two data points: the asset you plan to trade, and the independent variable you believe may influence the forward return of that asset.
The input can be something somewhat technical, such as an historical volatility indicator, or it may be something more fundamental, like earnings growth.
Whatever variables you choose, the input should relate to the output in a way that intuitively makes sense. For example, if the asset you plan to trade is the SPDR S&P 500 ETF Trust, you'll want to select an input that you believe likely influences the future return of US Equities, such as the spread between the 10-Year and 2-Year Treasuries. Choosing variables that relate to each other in a way that makes sense helps traders avoid the mistake of trading on data that are actually a false positive.
Once you confirm that a valid relationship exists, you can use a backtest to search for extreme input values. You'll want to test whether or not entering a trade at times when the input variable registered extreme values, resulted in forward returns that were significantly distinct from the returns generated when entering trades at random points in times.
After the backtest, a trader can assess whether the returns were in fact better than random, through a t-test. This process will show you how likely it would be that any outperformance of forward returns happened due to chance alone, or likely due in part to the influence of the input.
A trader should not assume a strategy is robust because it has been backtested under one set of input parameters and tested against historical data. One way to gain confidence in the robustness of a trading strategy is testing it against historical data divided into in-sample and out-of-sample buckets. The backtest results computed in the in-sample data can be compared with the results from out-of-sample data. A great trading strategy will have consistent performance across both samples.
Measuring Strategy Performance Across Different Market Regimes
Sometimes consistency across samples can't be achieved because a strategy may in fact be regime-specific, meaning it works well in one market regime but backfires when the market changes. This doesn't necessarily mean the strategy is useless; it just means the trader will need to take the market regime into account before executing it.
Here are some common mistake traders will want to avoid when backtesting:
A popular refrain among data-driven traders is "garbage-in-garbage-out". It refers to the importance of selecting datasets that posses good data hygiene; Simply put, traders who rely on low-quality datasets will end up with misleading backtest results.
Backtesting is less useful when a strategy has only worked for a short period of time. The amount of data required to backtest differs based on market conditions, but as a rule-of-thumb traders should avoid backtesting strategies with less than one year’s worth of daily trading data.
Overfitting occurs when a backtested strategy has been optimized too much, meaning it has been tweaked with the sole purpose of returning positive backtest results, but without much regard to whether or not the relationship between the variables is reasonable. This results in an inaccurate representation of the forward performance of the trading strategy.
More often than not you will find that the trading signals generated by backtests overlap each other, meaning they repeat consecutively over a number of days or weeks. It's important to consider this when taking the results of a backtest at face value given that the subsequent returns will also be overlapping.
The backtesting process should be an integral part of any trader's strategy development, not just something a trader does on the side, every now and then. It seems retail investors are finally coming around to embracing this idea.
The ranks of self-directed traders who include backtesting in their trading process is swelling. This trend is being driven by a number of factors: the growing body of R and Python backtesting packages available to developers, the increasing sophistication of the retail trading community, and the improved accessibility of backtesting platforms that do not require coding skills to execute.
Once the exclusive domain of investment professionals, backtesting is finally gaining acceptance as a practice among traders of all stripes. Whatever your experience level, understanding how to backtest your own strategies will help you become a more successful trader down the road.
Start with the free version and upgrade when you need a larger metric library and longer lookback periods.