Related Articles
Start Backtesting

How to Backtest Your Trading Strategy: A Comprehensive Guide

February 6, 2022
Albert Huang
Tradewell logo

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.

Picking Variables

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.

Avoiding False Positives

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.

Searching for Extreme Values

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.

Using T-Tests to measure significance in backtests

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.

Strategy Robustness

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.


Backtesting Mistakes to Avoid

Here are some common mistake traders will want to avoid when backtesting:

Relying on Data of Poor Quality

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 Against Small Sample Sizes

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 Strategies

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.

Overlapping Data

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.


Backtesting is Growing in Popularity

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.

Read This Next
Robson Chow
Backtest Study: So You Want to Short the S&P 500?
This study uses the tools of backtesting and data visualization to examine the challenge posed by selling the SPDR S&P 500 ETF Trust.
Read Article
Humza Sarwar
What is a Backtest?
Backtesting is a method used in trading and investment research to assess the quality of strategy by simulating its performance against historical data. Learn more about the basics of backtesting by reading this article.
Read Article
Albert Huang
How to Backtest Your Trading Strategy: A Comprehensive Guide
Backtesting plays a key role in developing a successful trading system. Read this article to discover the steps a trader must take to backtest a strategy.
Read Article
Albert Huang
VIX Trading Strategies to Backtest
This article will explain what the VIX Index is, what instruments a retail trader can trade to profit from changes in equity market volatility, and also reveals three VIX-related signals worth monitoring. 
Read Article
Humza Sarwar
What is Trading Analytics and How Can Traders Benefit?
This article will help you understand the basics of trading analytics and how they can improve your trading performance.We'll also walk you through some of the most popular analytics options today so that you can find a solution that meets your needs.
Read Article
Get started with Tradewell for free

Start with the free version and upgrade when you need a larger metric library and longer lookback periods.

METRICS SOURCED FROM TRUSTED PROVIDERS OF MARKET AND ECONOMIC DATA
TradeBlock logo
FRED logo
CBOE logo
IEX logo
EIA logo
CME Group logo
Tradewell logo
Tradewell
β
© 2021 Tradewell, Inc. All rights reserved.
Start Backtesting