What Is Backtesting? Definition & Example
Published 11:35 am Tuesday, August 1, 2023
- An investor can use backtesting to determine whether a specific trading strategy on a security or asset would have created potential returns based on past performance and historical data.
What Is Backtesting?
Backtesting is a method that uses historical data to test an investing or trading strategy to determine whether it would have produced returns over a specific period of time. An investor would review historical data and take a trading strategy to determine whether that strategy based on that data would work for a particular return on a stock or other type of security or asset.
The premise behind backtesting is that if a specific strategy would have generated returns in the past, replicating that strategy may be able to generate returns in the future.
Examples of investment strategies for backtesting include the use of technical analysis, including technical indicators such as moving averages, relative strength indexes, oscillators, Bollinger bands, and others that focus on trends and momentum.
Backtesting could also be based on an algorithm for algorithmic trading, or mathematical or statistical modeling for quantitative trading.
What Are the Main Points to Consider in Backtesting?
There are three major points to consider when conducting a backtest. Backtesting typically requires a specific trading strategy or idea, historical data, and measures on returns.
Trading Strategy
Picking a trading strategy is the first step in backtesting. This will determine what type of data will be collected and for how long.
Data
Collecting accurate data is important in backtesting. Data should be free of errors, and results from backtesting will depend on the type of historical data selected.
Key Performance Indicators
Key performance indicators are used to determine whether the performance of a trading strategy results in a profit or loss. Some of the common KPIs include total return, annualized return, and the Sharpe ratio.
Example of Backtesting
An investor uses a 50-day moving average as a trading strategy for a stock, and starts to collect price data going back to 2018 as a way to determine whether the stock can match similar returns in the future. The investor looks for patterns of the stock moving above the average, which could indicate a sell signal, while moving below that could be a buy.
The investor then simulates a trade by taking a position and tracking the performance over a period beginning from 2018. Based on the 50-day moving average, the buy and sell signals would indicate how much of a return, or loss, there would be on a specific day from the initial investment. Other measures such as annualized return and the Sharpe ratio could also be used to assess the performance of the trading strategy in the backtesting.
What Are the Limitations of Backtesting?
Past and present market and economic conditions differ, and there’s no guarantee that a strategy that would have been successful in the past will lead to similar results in the future. Backtesting is a hypothetical approach to investment, and won’t necessarily lead to similar returns or losses on future investments.
Interest rates, for example, could play an important role in past performance, with lower rates providing a beneficial investment environment on stocks, as opposed to higher borrowing costs when the backtesting is conducted.
Who Uses Backtesting?
Institutional investment firms such as hedge funds typically conduct backtesting to test their proprietary trading strategies. A mutual fund could conduct a portfolio backtest to simulate a specific investment strategy for a number of stocks in its portfolio of funds.
How Does Backtesting Differ From Stress Testing?
While backtesting relies on historical data of a security or asset, stress testing relies on simulated data. Banks, for example, would conduct stress tests based on hypothetical data to determine whether they would be able to withstand shocks to a financial system.