When you start trading in stock market, the questions arise are what stock to pick, when to buy, when to sell, which strategy yields profit and which one leads to loss. The answer for above questions is answered in this case study. Back testing 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.
When done effectively, a comprehensive backtesting framework can:
- Eliminate costly emotions during highs or lows, and invest based on facts
- Develop new, uncorrelated strategies that diversify your portfolio's risk
- Capture rare few times per year opportunities, that only backtesting can expose
- Give unique, tangible, and justifiable investment advice to your clients
- Identify superior alpha generating investment opportunities
- Demonstrate objective credibility to current and prospective investors
- Identify and mitigate behavioral biases in investment decision-making
- Provide an effective risk mitigation strategy
- Add or reduce existing positions in a methodical manner with historically proven results
How to backtest
- Clearly stated rules or hypothesis – Backtesting is a science and must follow the scientific method. As such, all models must have explicitly stated rules that are unambiguous, including criteria for entry/exit, time period for test, money management and any secondary criteria or conformation signals.
- Backtest - Backtest the hypothesis. Analyze the results of the strategy. What is the Profitability of system (profit factor). What is the win/loss ratio? What is the efficiency of model? What is the ROI?
- Refine – Systematically change inputs to find optimal trades. Make adjustments to profit targets, stop loss, time til expiration, and delta.
- Analyze - How does return compare to risk? How often does this strategy occur? How has the strategy performed over time? How has it done it up vs down markets? If I change one parameter are the results resilient? Do I have a theory on market behavior that explain why these results occur? Is the equity curve smooth?
- Trade - implement your trading model.