TradersEdgeSystems.com

Consulting | Custom Trading Systems
Built-In Indicators | Custom Indicators

December 2012 Stocks and Commodities Traders Tips


Using VIX To Forecast The S&P 500

AIQ Version:

Original article by Trent Gardner
AIQ Code by Richard Denning

The AIQ code for Trent Gardner’s article , “Using VIX To Forcast The S&P 500”, is provided at the web site noted below.

To test the author’s VIX timing system, I used the NASDAQ 100 list of stocks and AIQ’s Portfolio Manager. A long-only trading simulation was run with the following capitalization, cost and exit settings:

  • Maximum of 10 open positions
  • Size each position at 10 % of mark-to-market total capital
  • Take no more than 10 new positions per day
  • Compute the mark-to-market capital each day
  • Three cents per share was deducted for each round turn trade
  • Select trades based on the highest 28 bar Wilder RSI reading
  • Exit trades only with a system exit-no loss stop or profit target stop used

In Figure 1, I show the resulting statistics and long-only equity curve compared to the S&P 500 index. For the period 4/1/93 to 10/16/2012, the system returned an average internal rate of return of 22.9% with a maximum drawdown of 19.5% on 10/27/97.

Captions:
Figure 1 – Long-only equity curve compared to the S&P 500 for the test period 4/1/93 to 10/16/12 trading the NASDAQ 100 list of stocks.

EDS Code:
VIX forcast SPX.EDS
(right click and choose Save As)


 

Traders Studio Version :

Original article by Trent Gardner
Traders Studio Code by Richard Denning

The TradersStudio code for Trent Gardner’s article , “Using VIX To Forcast The S&P 500”, is provided at the web sites noted below. The following code files are provided in the download from the websites:

  • Function: “COUNTOF” a helper function that returns the number of times a rule is true
  • System: “VIX_COUNT” the author’s system plus my modified system.

Parameters:

  • useTrendFilter if = 1 then use the modified system else use author’s original one
  • maLen = moving average length for VIX average of lows
  • count = number of required days that the VIX or SP must be above or below its respective moving average
  • maMult = multiple of the maLen that is used to get the length of the moving average for the SP contract
I tested using the S&P 500 futures contract SP and the VIX index using Pinnacle data. I did an initial test of the author’s system and found that there was more draw down than I would like to see. As a result of the first test, I added a trend filter that requires the SP close to be above its moving average for the same number of days that the VIX must be below its moving average. The moving average on the SP contract is a multiple (input parameter=”maMult”) of the moving average used on the VIX. The modified system exits when either the VIX is above its moving average for the required days or the SP contract is below its moving average the same required days. Figure 1 shows the equity curve and underwater equity curve resulting from trading one contract and using a fully optimized parameter set for the modified system. For the test period of 1996 to 2012, the system with fully optimized parameters trading long only showed total profit of $224,813 with a maximum drawdown of $53,875. Optimized parameters often show overly rosy results compared to actual trading going forward. TradersStudio has the walk forward testing tool that helps us to evaluate how much deterioration there might be when actually trading a system. I ran a walk forward test on the modified system using an optimization window of approximately 4 years with a forward testing window of approximately 1 year. The results of the 1 year forward tests pieced together are shown in Figure 2. The equity curve is now not as good looking and the underwater equity curve is also worse. For the test period of 1996 to 2012, the system with walk forward parameters trading long only showed lower total profit of $140,025 with a higher maximum drawdown of $72,200.

Captions:
Figure 1 – Equity & underwater equity curves for the author’s system with the added trend filter from 1991 to 2012. This is for the fully optimized set of parameters.

Figure 2 – Walk forward equity & underwater equity corves for the author’s system with the added trend filter from 1996 to 2012. The first four years are skipped due to the initial optimization period.

Traders Studio Code:
VIX_COUNT.zip
(right click and choose Save As)

 

 

 

 

 

 

 

 

 

 

 

 

 

Disclaimer | Privacy Policy | Contact Us | Spam Blocker | ©2009 Traders Edge Systems