Backtesting is a key component of effective trading-system development. It is accomplished by reconstructing, with historical data, trades that would have occurred in the past using rules defined by a given strategy. The result offers statistics that can be used to gauge the effectiveness of the strategy. Using this data, traders can optimize and improve their strategies, find any technical or theoretical flaws, and gain confidence in their strategy before applying it to the real markets. The underlying theory is that any strategy that worked well in the past is likely to work well in the future, and conversely, any strategy that performed poorly in the past is likely to perform poorly in the future. This article takes a look at what applications are used to backtest, what kind of data is obtained, and how to put it to use!

Tutorial: Basics of Technical Analysis

The Data and The Tools
Backtesting can provide plenty of valuable statistical feedback about a given system. Some universal backtesting statistics include:

  • Net Profit or Loss - Net percentage gain or loss.
  • Time frame - Past dates in which testing occurred.
  • Universe - Stocks that were included in the backtest.
  • Volatility measures - Maximum percentage upside and downside.
  • Averages - Percentage average gain and average loss, average bars held.
  • Exposure - Percentage of capital invested (or exposed to the market).
  • Ratios - Wins-to-losses ratio.
  • Annualized return - Percentage return over a year.
  • Risk-adjusted return - Percentage return as a function of risk.

Typically, backtesting software will have two screens that are important. The first allows the trader to customize the settings for backtesting. These customizations include everything from time period to commission costs. Here is an example of such a screen in AmiBroker:


The second screen is the actual backtesting results report. This is where you can find all of the statistics mentioned above. Again, here is an example of this screen in AmiBroker:


In general, most trading software contains similar elements. Some high-end software programs also include additional functionality to perform automatic position sizing, optimization and other more-advanced features.

The 10 Commandments
There are many factors traders pay attention to when they are backtesting trading strategies. Here is a list of the 10 most important things to remember while backtesting:

  1. Take into account the broad market trends in the time frame in which a given strategy was tested. For example, if a strategy was only backtested from 1999-2000, it may not fare well in a bear market. It is often a good idea to backtest over a long time frame that encompasses several different types of market conditions.
  2. Take into account the universe in which backtesting occurred. For example, if a broad market system is tested with a universe consisting of tech stocks, it may fail to do well in different sectors. As a general rule, if a strategy is targeted towards a specific genre of stock, limit the universe to that genre; but, in all other cases, maintain a large universe for testing purposes.
  3. Volatility measures are extremely important to consider in developing a trading system. This is especially true for leveraged accounts, which are subjected to margin calls if their equity drops below a certain point. Traders should seek to keep volatility low in order to reduce risk and enable easier transition in and out of a given stock.
  4. The average number of bars held is also very important to watch when developing a trading system. Although most backtesting software includes commission costs in the final calculations, that does not mean you should ignore this statistic. If possible, raising your average number of bars held can reduce commission costs, and improve your overall return.
  5. Exposure is a double-edged sword. Increased exposure can lead to higher profits or higher losses, while decreased exposure means lower profits or lower losses. However, in general, it is a good idea to keep exposure below 70% in order to reduce risk and enable easier transition in and out of a given stock.
  6. The average-gain/loss statistic, combined with the wins-to-losses ratio, can be useful for determining optimal position sizing and money management using techniques like the Kelly Criterion. (See Money Management Using the Kelly Criterion.) Traders can take larger positions and reduce commission costs by increasing their average gains and increasing their wins-to-losses ratio.
  7. Annualized return is important because it is used as a tool to benchmark a system\'s returns against other investment venues. It is important not only to look at the overall annualized return, but also to take into account the increased or decreased risk. This can be done by looking at the risk-adjusted return, which accounts for various risk factors. Before a trading system is adopted, it must outperform all other investment venues at equal or less risk.
  8. Backtesting customization is extremely important. Many backtesting applications have input for commission amounts, round (or fractional) lot sizes, tick sizes, margin requirements, interest rates, slippage assumptions, position-sizing rules, same-bar exit rules, (trailing) stop settings and much more. To get the most accurate backtesting results, it is important to tune these settings to mimic the broker that will be used when the system goes live.
  9. Backtesting can sometimes lead to something known as over-optimization. This is a condition where performance results are tuned so highly to the past that they are no longer as accurate in the future. It is generally a good idea to implement rules that apply to all stocks, or a select set of targeted stocks, and are not optimized to the extent that the rules are no longer understandable by the creator.
  10. Backtesting is not always the most accurate way to gauge the effectiveness of a given trading system. Sometimes strategies that performed well in the past fail to do well in the present. Past performance is not indicative of future results. Be sure to paper trade a system that has been successfully backtested before going live to be sure that the strategy still applies in practice.

Backtesting is one of the most important aspects of developing a trading system. If created and interpreted properly, it can help traders optimize and improve their strategies, find any technical or theoretical flaws, as well as gain confidence in their strategy before applying it to the real world markets.

Tradecision ( - High-end Trading System Development AmiBroker ( - Budget Trading System Development.

Related Articles
  1. Technical Indicators

    Using Pivot Points For Predictions

    Learn one of the most common methods of finding support and resistance levels.
  2. Chart Advisor

    ChartAdvisor for November 20 2015

    Weekly technical summary of the major U.S. indexes.
  3. Chart Advisor

    Is This The Beginning Of A Downtrend In Home Builders?

    Falling lumber prices and weakness on the charts of home builders suggest that the next leg of the trend could be downward.
  4. Chart Advisor

    These Commodity ETFs Are Still Stuck Within A Downtrend

    Traders are turning toward exchange traded funds to get a sense of where the market is headed next. Taking a look at the charts in this article, it becomes clear that the bulls have their work ...
  5. Trading Strategies

    The Elements of a Perfect Momentum Trade

    Five technical elements build profits in high-risk momentum trading strategies.
  6. Chart Advisor

    Stocks at Major Resistance - Breakout or Reverse?

    These are four stocks that both short and longer-term traders will want to keep an eye on.
  7. Chart Advisor

    ChartAdvisor for November 6 2015

    Weekly technical summary of the major technical indicators.
  8. Economics

    Is the CAPE Ratio Predicting an Era of Low Returns?

    When the the CAPE ratio is high, as it is now, it can indicate a bubble economy nearing its peak. Are we headed towards another bust?
  9. Chart Advisor

    Parabolic SAR Buy Signals in Beaten Down Stocks

    These four stocks recently flashed a Parabolic SAR buy signal after declining for some time. Should you be looking for more upside?
  10. Chart Advisor

    ChartAdvisor for October 30 2015

    Weekly technical summary of the major U.S. indexes.
  1. What is the difference between financial capital and economic capital?

    The word "capital" has many different meanings in economics and finance. Financial capital most commonly refers to assets ... Read Full Answer >>
  2. What are some of the most common technical indicators that back up Doji patterns?

    The doji candlestick is important enough that Steve Nison devotes an entire chapter to it in his definitive work on candlestick ... Read Full Answer >>
  3. Tame Panic Selling with the Exhausted Selling Model

    The exhausted selling model is a pricing strategy used to identify and trade based off of the price floor of a security. ... Read Full Answer >>
  4. Point and Figure Charting Using Count Analysis

    Count analysis is a means of interpreting point and figure charts to measure vertical price movements. Technical analysts ... Read Full Answer >>
  5. How are double exponential moving averages applied in technical analysis?

    Double exponential moving averages (DEMAS) are commonly used in technical analysis like any other moving average indicator ... Read Full Answer >>
  6. What are the alert zones in a Fibonacci retracement?

    The most commonly used Fibonacci retracement alert levels are at 38.2% and 61.8%. A 50% retracement level is also commonly ... Read Full Answer >>

You May Also Like

Hot Definitions
  1. Turkey

    Slang for an investment that yields disappointing results or turns out worse than expected. Failed business deals, securities ...
  2. Barefoot Pilgrim

    A slang term for an unsophisticated investor who loses all of his or her wealth by trading equities in the stock market. ...
  3. Quick Ratio

    The quick ratio is an indicator of a company’s short-term liquidity. The quick ratio measures a company’s ability to meet ...
  4. Black Tuesday

    October 29, 1929, when the DJIA fell 12% - one of the largest one-day drops in stock market history. More than 16 million ...
  5. Black Monday

    October 19, 1987, when the Dow Jones Industrial Average (DJIA) lost almost 22% in a single day. That event marked the beginning ...
  6. Monetary Policy

    Monetary policy is the actions of a central bank, currency board or other regulatory committee that determine the size and ...
Trading Center