By: rbresearch
Jayce, The roc function is in the xts package. Make sure you have require(xts) before calling the roc function. Ross
View ArticleBy: Joshua Ulrich
Here’s another way to create the symbols_close object. # create new environment to store data symEnv <- new.env() # getSymbols assigns to new environment getSymbols(symbols, from='2000-01-01',...
View ArticleBy: Sergey G
I have problems replicating this analysis. First of all, the to.monthly(x, indexAt=”lastof”) does not get me the last day of the month, as I would expect, for example: > x to.monthly(x,...
View ArticleBy: rbresearch
Hi Sergey, I am unable to replicate your error. One thing to note is that the blog post uses data from 2005 to 2012 and it looks like you are using data from 2000 to 2013 so the data will be different....
View ArticleBy: daniel
Hi All, Anybodoy could explain me why is the rank apply to the negative value of the roc matrix? r <- as.xts(t(apply(-roc, 1, rank))) Thx in advance!
View ArticleBy: daniel
Hi Sergey G, You can solve your problem by setting a fix timezone in your execution: Sys.setenv(TZ = “UTC”) XLY.Adjusted XLP.Adjusted XLE.Adjusted XLF.Adjusted 2000-01-31 1 2 3 4 2000-02-29 1 2 3 4...
View ArticleBy: rbresearch
Hi Daniel, The negative value is so that the asset with the greatest return will receive a rank of 1. This can be demonstrated with the following snippet of code: set.seed(12) x <- rnorm(5) rank(x)...
View ArticleBy: daniel
Thx Ross! Really impressive job with these posts!! Congratulations! Regards Daniel
View Article
More Pages to Explore .....