Skip to content

Instantly share code, notes, and snippets.

@joshuaulrich
Forked from jaredwoodard/CBOE_csv_to_xts
Created October 19, 2012 02:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuaulrich/3915891 to your computer and use it in GitHub Desktop.
Save joshuaulrich/3915891 to your computer and use it in GitHub Desktop.
pulls csv files from the CBOE and converts them to xts
library(quantmod)
# we're pulling the Google VIX index (VXGOG) but this also works for VXAPL, VXGS etc.
# see http://www.cboe.com/micro/equityvix/introduction.aspx
url <- "http://www.cboe.com/publish/ScheduledTask/mktdata/datahouse/VXGOGDailyPrices.csv"
# use read.zoo to read the data directly into a zoo object
z <- read.zoo(url, header=TRUE, sep=",", skip=1, FUN=as.Date, format="%m/%d/%Y")
# convert to xts
x <- xts(z, frequency="d")
chart_Series(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment