Skip to content

Instantly share code, notes, and snippets.

@isomorphisms
Created July 20, 2013 03:36
Show Gist options
  • Save isomorphisms/6043758 to your computer and use it in GitHub Desktop.
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 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
@isomorphisms
Copy link
Author

@jaredwoodard Sterling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment