Free and Easy Currency Monitor in R

March 22, 2011

(This article was first published on Timely Portfolio, and kindly contributed to R-bloggers)

Certainly not the best way to keep up with currencies, but the increasingly important job of monitoring currencies can be free and easy in R using Federal Reserve FRED data.  Here is a template that can be adjusted to your favorite currencies with symbols listed here.

See my previous post on how to monitor the potential US Dollar Collapse cheaply and easily.  Also, currencies are important again, so do not ignore them when investing.  Don’t say I did not warn you and don’t make excuses that you don’t have expensive gear.

From TimelyPortfolio
From TimelyPortfolio

R code:


#get asian currency data from the FED FRED data series
getSymbols(“DEXKOUS”,src=”FRED”) #load Korea
getSymbols(“DEXMAUS”,src=”FRED”) #load Malaysia
getSymbols(“DEXSIUS”,src=”FRED”) #load Singapore
getSymbols(“DEXTAUS”,src=”FRED”) #load Taiwan
getSymbols(“DEXCHUS”,src=”FRED”) #load China
getSymbols(“DEXJPUS”,src=”FRED”) #load Japan
getSymbols(“DEXTHUS”,src=”FRED”) #load Thailand
getSymbols(“DEXBZUS”,src=”FRED”) #load Brazil
getSymbols(“DEXMXUS”,src=”FRED”) #load Mexico
getSymbols(“DEXINUS”,src=”FRED”) #load India
getSymbols(“DTWEXO”,src=”FRED”) #load US Dollar Other Trading Partners
getSymbols(“DTWEXB”,src=”FRED”) #load US Dollar Broad

par(mfrow=c(3, 4)) #provides 2 columns and 3 rows for charts
plot(coredata(DTWEXO[“1995::2011″]),type=”l”,ylab=”US Dollar Other”)
plot(coredata(DTWEXB[“1995::2011″]),type=”l”,ylab=”US Dollar Broad”)

#if you prefer a prettier chart then you can use
chartSeries(to.monthly(1/DEXSIUS),theme = chartTheme(“white”),name=”Singapore Dollar/USD”,TA=”addBBands(10)”)

To leave a comment for the author, please follow the link and comment on their blog: Timely Portfolio. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...


Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)