This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is code for charting individual VIX futures contracts. You need to know the contract letter and year | |
# http://cfe.cboe.com/Publish/ScheduledTask/MktData/datahouse/CFE_Z12_VX.csv | |
library(quantmod) | |
mth <- 'X' | |
yr <- 12 | |
n <- 10 # number of periods for calculating historical volatility in the chart | |
url <- paste0("http://cfe.cboe.com/Publish/ScheduledTask/MktData/datahouse/CFE_",mth,yr,"_VX.csv") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
symb = read.csv(url,header=FALSE, stringsAsFactors=F) | |
symb <- symb[-1,] | |
colnames(symb) <- c(symb[1,]) | |
symb <- symb[-1,] |