Retrieving the VIX term structure in R

  Much of my time lately has gone into analyzing and trading products in the volatility complex.  As a result, I regularly watch the VIX term structure for continuations or deviations from trend.  To make analysis simpler, I’ve written some R code that rips the term structure off the CBOE VIX term structure page and parses it into a table with proper typing.  You can view this code in the embedded gist below:

CEO and Founder of Bommarito Consulting. View Michael's profile here.

Tagged with: , ,
Posted in Consulting, Programming
One comment on “Retrieving the VIX term structure in R
  1. Garrett says:

    You’ll likely be interested in the getSymbols.cfe method in my qmao package (https://r-forge.r-project.org/R/?group_id=1113)

    The following comes from the examples section of ?getSymbols.cfe

    library(qmao)
    getSymbols(c(“VX_U11″, “VX_V11″),src=’cfe’)
    #all contracts expiring in 2010 and 2011.
    getSymbols(“VX”,Months=1:12,Years=2010:2011,src=’cfe’)
    #getSymbols(“VX”,Months=1:12,Years=10:11,src=’cfe’) #same
    #The contracts expiring this month:
    getSymbols(c(“VM”,”GV”),src=’cfe’)

    If you are not familiar with quantmod/getSymbols, by default, it assigns the data to an environment (.GlobalEnv by default) instead of returning it. So, e.g. after running getSymbols(“VX_H12″) the data will be in a variable named VX_H12.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>