Created
July 20, 2013 03:36
-
-
Save isomorphisms/6043758 to your computer and use it in GitHub Desktop.
$USDX or $USD:IND, the USD index basket. #forex #currency #oanda #FRED
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 | |
k <- .042 | |
f <- .036 | |
# basket weights should sum to 1 | |
sum(c(e,y,s,l,k,f))==1 | |
USDX <- 50.14348112 * USDEUR^e * USDJPY^y * USDGBP^s * USDCAD^l * USDSEK^k * USDCHF^f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice. Not that it matters, but I get the letters used for the weights in each case except: GBP and 's'?