Using VIX To Trade SPY And The S&P 500 (Amibroker And Tradestation Code)

The strategy in plain English:

  1. Calculate a 15-day Bollinger Band for the VIX (not SPY or the S&P 500) by using a standard deviation of 1.75.
  2. When the VIX breaks above upper band, go long the S&P 500 at the close.
  3. Exit at the close when the close is higher than yesterday’s high.

Click here for the original article.

Amibroker code:

setOption(“holdminbars”,1);

Fremmed=Foreign(“^VIX”,”close”,fixup=1);

Buy= fremmed>BBandTop(fremmed,15,1.75);

buyPrice= Close;

Sell= C>Ref(H,-1);

sellPrice= Close ;

Tradestation code:

If c data2 > BollingerBand(Close data2,15,1.75)

then buy this bar at close;

If close > high[1] then sell this bar at close;

Disclosure: We are not financial advisors. Please do your own due diligence and investment research or consult a financial professional. All articles are our opinions – they are not suggestions to buy or sell any securities.