Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Using VIX as an indicator

This is a simple script I'm trying to complete that notes a MA crossover based on the VIX. I'm having a time importing historical VIX data and getting it to work. I've searched the forum and tried to implement other examples, like from here, but to no avail. They are either not what I'm looking for or they are over my head. Is it possible to import and format it so that it could be used similarly like a data object? I'd love to be able to expand this concept and apply it to other indicators in a similar fashion. I have used AAPL as a placeholder for the VIX data in the backtest so it could finish. Any help or guidance is appreciated.

3 responses

Dave,
Looks like the post
https://www.quantopian.com/posts/stale-vix-pipeline-feed
shows two ways to get at VIX.

I modified that code slightly (changed target of "out[:] =" in CustomFactor to fix a bug.
Also used record() to plot custom data...click on two versions of VIX to see is_match series...slight mismatch only in two places.

Hopefully, this will help you.
alan

Alan,

Thanks for your code, it looks accurate. My problem is that I don't know how to use it. My python skills are on the novice side and I don't know how to take your code and obtain two moving averages, or any other indicator, for the VIX.

Dave,

You may create custom factor in pipeline or create two moving averages as in this sample.