How to Backtest Stock Strategies

How to Backtest Stock Strategies

Backtesting is the process of applying  a strategy of entry and exit signals to historical price data to see if the system would have made money in the past. Systems that create good risk/reward ratios with bigger winning trades than losers or a high winning percentage of trades with no big losses will backtest as profitable. Most backtested systems attempt to capture trends in markets and limit losses by not being on the wrong side of a trend. 

Here is what you need to backtest a strategy. 

  1. You need backtesting software to make the whole process much faster and easier. 
  2. You need technical signals that you believe has the potential to capture trends in the markets. 
  3. A watch list of stocks and indexes that fit your parameters for trading. 
  4. Technical entry signals that tell you when to get it. These can be moving averages, MACD, RSI, or price action parameters, etc.. 
  5. Technical exit signals that tell you when to get out if your trade turns into a loser, this is an initial stop loss. These can be moving averages, MACD, RSI, or price action parameters etc.. 
  6. How you will exit winning trades for a profit. A profit target or a trailing stop in your system helps you to know when to maximize your gains. Short term moving averages make great trailing stops and overbought RSI levels make good price targets. 
  7. Execute the backtest over a long enough period of time to see how it did during up trends, downtrends, and range bound markets.
  8. Look at your risk/reward ratio your average winning trading versus your average losing trade. 
  9. Be aware of your winning percentage so you know how many losses to expect over time. 
  10. Look at your total percentage return over the time period of the backtest and compare to buy and hold for the same stock or index. 
  11. Look at the maximum drawdown to see the risk adjusted return and the maximum pain that you would need to endure. 
  12. Backtest the same signals over your whole watch list to see which signals are an edge their self. 
  13. Combine your winning backtests together to create a trading system with multiple markets. 
  14. When you have faith in yourself to stay disciplined and your system to make money over the long term it is time to go live. 
  15. Trade your system with discipline and perseverance over the long term. 

All a backtest is really trying to do is use mechanical and repeatable signals that give profitable entry and exit signals that create bigger wins and smaller losses over the long term. This is accomplished by cutting losses short and letting winners run. A system has to have signals that filter out a lot of the price action noise that causes over trading and instead signal the meaningful moments in price action. Trading back tested signals also filters out the emotion of trying to decide what to do each day from your own perspective. You convert from and opinionated predictor to the follower of a systematic process. Your job becomes to follow signals and ignore your own feelings. 

There is no perfect backtested system there is just the system that you can confirm that worked over multiple markets in the past and has a great potential for working in the present and future over the long term.

“The moral is simple: Don’t draw any conclusions about a system (or indicator) on the basis of isolated examples. The only way you can determine if a system has any value is by testing it (without benefit of hindsight) over an extended time period for a broad range of  markets.” – Jack Schwager

For a shortcut and time saver on learning the basic principles of backtesting, check out my Backtesting 101 eCourse here.