How to backtest trading systems and avoid curve fitting

The Ideal Backtesting Scenario. The ideal backtest chooses sample data from a relevant time period of a duration that reflects a variety of market conditions. In this way, one can better judge whether the results of the backtest represent a fluke or sound trading.

Trade Using Relative Strength Relative Strength is a trading style that is intuitive and easy to understand.

Test Your Ideas before Risking Your Money

Backtest. Automate. Gain Your Edge! Right Edge is a trading system development platform based on modern, compiled languages. Use RightEdge to design, develop and backtest trading systems. RightEdge can be used to execute fully automated trading systems.

Some universal backtesting statistics include: Net profit or loss - Net percentage gained or lost 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 Backtesting Software Typically, backtesting software will have two important screens.

Here is an example of such a screen in AmiBroker: Again, here is an example of this screen in AmiBroker: Here is a list of the most important things to remember while backtesting: For example, if a strategy was only backtested from to , it may not fare well in a bear market.

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. 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 to reduce risk and enable easier transition in and out of a given stock. Basics of Trading Systems. Although most backtesting software includes commission costs in the final calculations, that does not mean you should ignore this statistic.

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. Traders can take larger positions and reduce commission costs by increasing their average gains and increasing their wins-to-losses ratio.

Money Management Using the Kelly Criterion. Annualized return 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.

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. Backtesting can sometimes lead to something known as over-optimization. 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 the rules are no longer understandable by the creator.

Right Edge is a trading system development platform based on modern, compiled languages. Use RightEdge to design, develop and backtest trading systems. RightEdge can be used to execute fully automated trading systems. Our platform is equipped with a cutting edge integrated development environment IDE that includes advanced charting features, a full library of technical indicators, data management, and a pluggable architecture that allows for a high level of scalability and customization.

Build trading systems for stocks, futures, options and forex. RightEdge supports multiple time frames so that it is valuable to both day traders as well as swing traders. With powerful charting, technical indicators and array of objects such as Fibonacci lines, support and resistance and more, RightEdge will also appeal to those who perform demanding technical analysis. RightEdge caters to trading system developers that demand high performance systems utilizing industrial strength data storage for high frequency data.

Once a trading system is developed, RightEdge can backtest trading systems, make optimization recommendations, and ultimately interface with supported brokers to execute automated trading systems live.

Trading systems are executed in a truly event driven fashion allowing for the same code to be run in a backtest simulation or live scenario. RightEdge supports those involved in stock trading, futures trading and forex trading no matter what the time frame!