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 computes the USD index which is the "broad measure of the US Dollar against a BASKET of currencies" rather than against a particular pair | |
getFX(c("USD/EUR", "USD/JPY", "USD/GBP", "USD/CAD", "USD/SEK", "USD/CHF")) | |
# The formula comes from ICE markets https://www.theice.com/publicdocs/futures_us/ICE_Dollar_Index_FAQ.pdf | |
e <- .576 | |
y <- .136 | |
s <- .119 | |
l <- .091 |
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" | |
# 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 |