How to Evaluate, Backtest and Validate a Trading Strategy

Timothy Jaeger
5 min readAug 18, 2016

Lately I have been working with backtesting various strategies I invent or find from sites such as TradingView. I will walk you through the process of how I:

  1. Identify a possible strategy
  2. Find a variety of stocks to run through a structured backtest
  3. Perform the actual backtest itself.

At the end of these 3 steps I can identify how successful the strategy is and whether I should use it for live trading, and (approximately) how much I could expect to make in a given time period based on a given number of trades.

Identifying the Strategy

TradingView has a number of strategies that various members contribute.

I identified this strategy put together by Chris Moody on TradingView. It’s called the Williams VIX Fix and it is based on the writings of Larry Williams around a synthetic Vix calculation. If you’d like to learn more about the VIX, Wikipedia is a great place to start.

After doing some visual backtesting across a number of currencies, I developed a simple trading system that I wanted to test. The rules of this system are simple:

  1. Enter a long trade for all aggressive or filtered entry signals generated by the system, unless the Stochastic RSI is close to or above 80 (Stochastic RSI is a freely-available indicator on TradingView and a number of other financial charting platforms)
  2. Exit the trade when the RSI is above 80 and the K line crosses through the D line
  3. If multiple signals occur, add to the current position assuming the conditions in #1 above are met (e.g. if there are two filtered entries on concurrent days one would purchase the same # of shares on day 2 as on day 1)

I didn’t take into account Money Management for the rules as they will vary for each individual trader.

Finding Stocks to Backtest

I used both FinViz’s Map and Unicorn Bay to find a range of currencies to backtest. My criteria for selecting currencies is as follows:

  1. Test currencies across sectors and industries (to avoid testing against, say, all tech stocks during years that tech stocks saw a boom)
  2. Test at least 2 highly dissimilar / uncorrelated currencies to see how the strategy works against vastly different data sets
FInViz’s map showing securities across a range of sectors / industries
Two currency correlations from Unicorn Bay’s Most / Least Correlated Securities

The currencies I decided to backtest were:

  1. AIG (Financial — Property / Casualty Insurance)
  2. DUK (Energy)
  3. GE (Industrial Goods — Diversified Machinery)
  4. GILD (Biotechnology)
  5. GS (Financial — Investments)
  6. HD (Services — Home Improvement)
  7. JNJ (Healthcare)
  8. KO (Consumer Goods — Beverages)
  9. MSFT (Technology — Business Software)
  10. NI (Utilities — Diversified Materials)
  11. WMT (Services — Discount Variety)

In addition, I tested two highly uncorrelated securities, identified from Unicorn Bay’s Most / Least Correlated Assets page:

  1. FBR (Consumer Goods)
  2. T (Technology)

Running the Backtest

I then ran these through TradingSim, a trading simulator where you can practice actual strategies using a simulated account. Using this software, you can open positions on stocks using a fake account and trade as if they were real stocks. The only drawback is that the backtest is only 2 years.

I proceeded to run the backtest for each stock over the full 2 years with a fake $10,000 account. For each trade, I put ~ 20% of capital at risk (which is not necessarily what you would do in the real world, but I wanted to amplify the results in this case). The results were promising. Over a 2 year period, each stock made a health return. The individual trades are listed here.

TradingSim Gain / Loss History for each pair grouped by pair.

Further Backtesting

While these initial results were promising, 2 years of backtesting really wasn’t enough. In order to further stress-test it, I coded up a Strategy in TradingView based on the rules of my trading system. You can find the system here. You can view and modify it if you wish on TradingView.

TradingView Strategy — published on TradingView

TradingView’s data goes back much further (at least all the way to 1968 for many stocks), so I tested each of the 13 stocks again using the same virtual $10,000 account to see whether they ended up in profit.

Only 1 out of the 13 pairs did not come out profitable (GS — Goldman Sachs). I decided to figure out why this was, and if there were any patterns that could be understood about any stocks that might not be useful to use this strategy for.

I used TradingView’s screener to test the strategy out on a variety of lower volatility stocks, and found a number of candidates that seem suitable for forward testing due to their high profit factor. A growing list of stocks that exhibit high profit potential with this strategy is viewable here. Below are some screenshots of some of the backtested stock performances.

PEP backtest from 1968 to present
AFL backtest from 1968 to present
UL backtest from 1968 to present

Again, none of this is to say that simply putting your all money on AAPL back in 2004 and simply holding isn’t a great strategy. You can do that, as well as have predictable profits even through market dips like in 2001 and 2008 and, through some compounding, make decent cash with strategies like this one.

Next steps:

  1. Forward-test a number of stocks using Robinhood and showcase positive results, then increase capital contributions
  2. Code the strategy / algorithm up on Quantopian and gain support / capital to trade this strategy
  3. Find / develop other strategies that are suitable for trading

Disclaimer: All of this is speculative and not considered to be definitive investment advice. I am not responsible for any profits or losses one experiences using this strategy, either in partial or full format. I am not an investment professional or broker. Please do further research before using any of the strategies described in this post.

Notes / Links:

Credit for Williams VIX FIX strategy goes to Chris Moody.

Strategy used on TradingView available here.

List of stock tickers that show great returns and equity curves available here.

--

--

Timothy Jaeger

Experienced Product Designer, investor (stocks, crypto), Futurist. Interested in economics, socio-cultural trends, human behavior.