TradingView
saolof
3. Mrz. 2020 04:39

VIX + moving average low-drawdown SPY strategy 

SPDR S&P 500 ETF TRUSTArca

Beschreibung

Aims to be a simple way to avoid recessions by combining two complementary tools that work well together: A simple moving average crossover (death cross & golden cross) to detect a bull markets and run with it, and a crossover between the VIX and a moving average of its previous peaks to get out as quickly as possible during periods of volatility.

The Death cross gets you out of slow drawn-out bear markets. The VIX gets you out of sudden rapid crashes.
Kommentare
jptrader956
Hi, How to access the code? is there any subscription or cost to access the code
ManSteve
Hi, what is the blue Moving Average above the VIX? it looks like a MACD with only positive moving average?
nevins
This is awesome. Thanks for sharing. How do you create a strategy based on one variable like the VIX but it trades a different variable like the SPY?
vadingtrue
well thought out, but doesnt work well on nasdaq or DJ30.. if the principles are right shouldnt it apply to these as well ?
saolof
@vadingtrue, This script takes the CBOE:VIX as input, which is the implied volatility of the S&P500. If you want it to work for other indexes you need to use the implied volatility for that index as input.
Sitnick
Hi, good work, i send private message to you, answer me please
funnidesign
great work. Just curious how did you define the peak when you calculate the moving average of its previous peaks for VIX? say is it like the maximum VIX in 250 trading days?
saolof
@funnidesign, Right, it has a highest(vixHighs,highest_length) term inside the moving average. It has a few parameters that you can play around with to get better results in backtesting, but I've generally tried to avoid p-hacking here.
funnidesign
@saolof, thanks for your reply. 8% drawdown in SPY is nice but I'm thinking again what makes the vix moving average works here, as i can see the vix moving average remains constant most of the time and it only spikes after vix falls back to normal range. In other words, looks like there is a time lag component in your moving average as well but what is the rationale behind this? my concern is it could be curve fitting right here?
saolof
@funnidesign, It's intended to be a smooth long-term average with a convolution kernel that is insensitive to recent spikes.

I want a long-term average to make it less sensitive to random noise during long periods of high VIX. I want it to be insensitve to recent spike based on the assumption that a piece of bad news will make the implied volatility spike and then slowly decay, where the spike is the part that predicts stock underperformance.

The averaging length/time lag is intentionally picked more or less randomly. If you pick a specific time lag from backtesting data you can do a lot better.
Mehr