Backtesting is an essential practice for anyone looking to develop automated trading systems. Using historical prices for multiple securities, traders can optimize the profitability and enhance the durability of their "trading systems":http://traderhq.com/10-relics-only-traders-appreciate. There are many tools available to assist in the process of developing and backtesting trading systems across many different markets, including both equities and forex markets.
In this article, we’ll take a look at what backtesting entails, some essential resources, and limitations to keep in mind before trading with real capital.
What Is Backtesting?
Trading systems consist of computer programs that automate the process of buying and selling securities based on a set of rules. By applying the rules to historical prices, traders can evaluate the profitability and risk associated with their trading systems without putting any real capital at risk. The process of applying a trading system to historical prices is known as backtesting that trading system.
For example, suppose that a trader devises a trading system that generates a buy signal when the 10-day moving average crosses above the 50-day moving average and a sell signal when the 10-day moving average crosses below the 50-day moving average. By applying these rules to historical prices, traders can see how much they could have generated and the volatility risks taken in the process [see also Ultimate Guide to Bollinger Bands].
Some key data points that traders might find useful from backtesting include:
- Profit/Loss – Traders can determine the overall profit or loss over a period of time expressed as a percentage of initial capital, which provides a rough guide of how profitable the trading system might be when pushed live.
- Max Drawdown Traders can determine the maximum loss of initial capital that a trading system generates over a period of time, which is useful when considering margin requirements and other leverage-related concerns.
- Sharpe Ratio Traders can determine a trading system’s Sharpe Ratio, which provides a great indicator of overall risk-adjusted returns.
How to Backtest
Backtesting can be accomplished manually, but complex trading systems can make the process quite daunting. Using a variety of different software programs, traders can input their trading system’s rules and automatically backtest the strategy against a wide range of historical timeframes and securities. Many software programs also report detailed risk and profitability analyses (as seen above).
The most popular integrated broker and backtesting platform is TradeStation and its Portfolio Maestro®. While TradeStation’s brokerage clients have access to the platform for free (if they meet certain criteria), the software platform is available to the general public for $59.95 per month. The platform enables portfolio-level backtesting, analytics, optimization, and performance reporting.
Wealth-Lab is another option that has both free and premium options. With both a drag-and-drop strategy wizard and the ability to use complex scripting language, the software platform caters to both novice and professional traders. Pre-made strategies and multi-system backtesting provide additional options designed to help improve trading systems and implement profitable strategies.
QuantConnect is a relatively new option that provides free backtesting software for quantitative traders. Based on the C# programming language, traders using the software should have a good understanding of basic programming concepts in order to interact with the extensive API. The company itself seeks to invest in profitable algorithms and share the profits as a means of generating revenue.
In the end, these three backtesting software solutions are just a few of many options available to traders. Many software programs are available free of charge – at least for a trial period – while others are either paid or bundled with brokerages. While most platforms require some knowledge of programming, others are designed with drag-and-drop tools designed to make trading system development easy.
Traders should be aware of the many limitations associated with backtesting trading systems before using these tools. By failing to account for these limitations, losses can quickly add up in cases of frequent and/or automated trading. A great way to avoid these problems is to extensively test trading systems using paper money and live data and then using small amounts of real money with live data.
Some of the key limitations to consider include:
- Prediction Risk – Past performance does not necessarily correlate with future performance, since the financial markets are extremely dynamic. In fact, competitive edges regularly pass quickly when discovered.
- Curve Fitting – Optimizing past performance can result in highly-specific trading strategies that are “curve fitted” to the past and unlikely to be broad enough to perform well in the future, especially with unexpected events.
- Data Resolution – Depending on the frequency of trading, some backtesting data may only provide one-minute or one-day resolution rather than up-to-the second data seen in live real-time trading environments.
- Slippage – Many trading systems fail to account for random factors like slippage in order pricing, which can result in large changes to the profitability and risk profiles of trading systems.
Of course, there are many other possible limitations that should be considered when developing and backtesting trading systems. Traders can avoid many of these problems by ensuring they are using a solid platform that provides granular data, accounting for slippage in cases where it’s relevant, and being careful to not refine a trading system so much that it becomes “curve fitted” to historical results.
The Bottom Line
Traders looking to automate or make trades based on a set of rules should always backtest their strategies before applying them in the live market. By simulating historical market activity, traders can ensure that live trading won’t yield any nasty surprises in terms of unexpected trading behavior. However, backtesting isn’t perfect that there are many limitations that traders should consider as well.
If you’ve enjoyed this article, sign up for the free TraderHQ newsletter; we’ll send you similar content weekly.