Skip to content

Instantly share code, notes, and snippets.

@milktrader
Created May 11, 2011 00:45
Show Gist options
  • Save milktrader/965697 to your computer and use it in GitHub Desktop.
Save milktrader/965697 to your computer and use it in GitHub Desktop.
adds returns to xts object
pulp <- function(sym){
require("quantmod")
juice <- getSymbols(sym, auto.assign=FALSE)
juice$log_ret <- dailyReturn(Cl(juice), type="log")
assign(sym, juice, envir=.GlobalEnv)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment