What is 'Backtesting'

Backtesting is the process of testing a trading strategy on relevant historical data to ensure its viability before the trader risks any actual capital. A trader can simulate the trading of a strategy over an appropriate period of time and analyze the results for the levels of profitability and risk.

BREAKING DOWN 'Backtesting'

If the results meet the necessary criteria that are acceptable to the trader, the strategy can then be implemented with some degree of confidence that it will result in profits. If the results are less favorable, the strategy can be modified, adjusted and optimized to achieve the desired results, or it can be completely scrapped.

A significant amount of the volume traded in today’s financial market is done by traders that use some sort of computer automation. This is especially true for trading strategies based on technical analysis. Backtesting is an integral part of developing an automated trading system.

Meaningful Backtesting

When done correctly, backtesting can be an invaluable tool for making decisions on whether to utilize a trading strategy. The sample time period on which a backtest is performed on is critical. The duration of the sample time period should be long enough to include periods of varying market conditions including uptrends, downtrends and range-bound trading. Performing a test on only one type of market condition may yield unique results that may not function well in other market conditions, which may lead to false conclusions.

The sample size in the number of trades in the test results is also crucial. If the sample number of trades is too small, the test may not be statistically significant. A sample with too many trades over too long a period may produce optimized results in which an overwhelming number of winning trades coalesce around a specific market condition or trend that is favorable for the strategy. This may also cause a trader to draw misleading conclusions.

Keeping it Real

A backtest should reflect reality to the best extent possible. Trading costs that may otherwise be considered to be negligible by traders when analyzed individually may have a significant impact when the aggregate cost is calculated over the entire backtesting period. These costs include commissions, spreads and slippage, and they could determine the difference between whether a trading strategy is profitable or not. Most backtesting software packages include methods to account for these costs.

Perhaps the most important metric associated with backtesting is the strategy’s level of robustness. This is accomplished by comparing the results of an optimized back test in a specific sample time period (referred to as in-sample) with the results of a backtest with the same strategy and settings in a different sample time period (referred to as out-of-sample). If the results are similarly profitable, then the strategy can be deemed to be valid and robust, and it is ready to be implemented in real-time markets. If the strategy fails in out-of-sample comparisons, then the strategy needs further development, or it should be abandoned altogether.

  1. Forex Trading Strategy

    A forex trading strategy is a set of analyses that a forex day ...
  2. Sampling

    Sampling is a process used in statistical analysis in which a ...
  3. Trading Strategy

    A set of objective rules designating the conditions that must ...
  4. Mechanical Investing

    Buying and selling stocks according to a screen based on predetermined ...
  5. Sample

    A sample is a smaller, manageable version of a larger group. ...
  6. Attribute Sampling

    Attribute sampling is a statistical method typically used in ...
Related Articles
  1. Trading

    Backtesting: Interpreting the Past

    We explain what backtesting is and offer some tips on how it can help refine your current trading strategies.
  2. Trading

    Backtesting and forward testing: The importance of correlation

    Correlations between backtesting and forward performance testing results can help you optimize your trading system.
  3. Trading

    Beginner Trading Fundamentals

  4. Trading

    Bad Luck With Trades? 5 Things You Might Be Doing Wrong

    If you're in a trading rut, ask yourself these five questions to help turn the corner.
  5. Trading

    Top 10 Rules For Successful Trading

    Whether you're a novice or an expert, these 10 rules should be the backbone of your trading career.
  6. Trading

    No Forex Strategy Of Your Own? Try Mirror Trading

    There are many advantages to trading a mirror strategy, yet markets are dynamic, and regardless there is always a risk of losses.
  7. Investing

    Interpreting a Strategy Performance Report

    A strategy performance report can provide key metrics to decide if your strategy is a winner.
  1. What percentage of the population do you need in a representative sample?

    Learn about representative samples and how they are used in conjunction with other strategies to create useful data with ... Read Answer >>
  2. What's the difference between a representative sample and a random sample?

    Explore the differences between representative samples and random samples, and discover how they are often used in tandem ... Read Answer >>
  3. What is the difference between systematic sampling and cluster sampling?

    Learn about the differences between systematic sampling and cluster sampling, including how the samples are created for each ... Read Answer >>
  4. When is it better to use systematic over simple random sampling?

    Learn when systematic sampling is better than simple random sampling, such as in the absence of data patterns and when there ... Read Answer >>
  5. What is the difference between a simple random sample and a stratified random sample?

    Learn about the differences between simple random sampling and stratified random sampling, and the advantages of each method. Read Answer >>
  6. What are the advantages and disadvantages of using systematic sampling?

    Learn about the primary advantages and disadvantages of using a systematic sampling method when conducting research of a ... Read Answer >>
Hot Definitions
  1. Gross Margin

    A company's total sales revenue minus its cost of goods sold, divided by the total sales revenue, expressed as a percentage. ...
  2. Inflation

    Inflation is the rate at which prices for goods and services is rising and the worth of currency is dropping.
  3. Discount Rate

    Discount rate is the interest rate charged to commercial banks and other depository institutions for loans received from ...
  4. Economies of Scale

    Economies of scale refer to reduced costs per unit that arise from increased total output of a product. For example, a larger ...
  5. Quick Ratio

    The quick ratio measures a company’s ability to meet its short-term obligations with its most liquid assets.
  6. Leverage

    Leverage results from using borrowed capital as a source of funding when investing to expand the firm's asset base and generate ...
Trading Center