Skip to content

Instantly share code, notes, and snippets.

@VermeirJellen
Created December 27, 2016 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VermeirJellen/e137d40fc9dcdcf4219f579a03e4b686 to your computer and use it in GitHub Desktop.
Save VermeirJellen/e137d40fc9dcdcf4219f579a03e4b686 to your computer and use it in GitHub Desktop.
source("config/config.R")
SPDR <- readRDS(file="data/SPDR.rds")
SPDR.returns <- na.omit((SPDR / lag(SPDR, k= 1) - 1) * 100)
###########################################################################
############# Plot the underlying SPDR assets #############################
###########################################################################
nrAssets <- ncol(SPDR)
par(mfrow=c(rep(ceiling(sqrt(nrAssets)),2)))
res <- sapply(1:nrAssets, function(x) plot(time(SPDR[,x]),
coredata(SPDR[,x]), main=names(SPDR)[x],type="l",
xlab="Time",ylab="Price"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment