Quantcast
Channel: Comments on: Momentum with R: Part 1
Browsing latest articles
Browse All 13 View Live

By: rbresearch

Jayce, The roc function is in the xts package. Make sure you have require(xts) before calling the roc function. Ross

View Article



By: 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 Article

By: 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 Article

By: Sergey G

Oh, “x” in the above is XLE.

View Article

By: 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 Article


By: 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 Article

By: 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 Article

By: 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 Article


By: rbresearch

Thanks for the tip daniel!

View Article


By: daniel

Thx Ross! Really impressive job with these posts!! Congratulations! Regards Daniel

View Article
Browsing latest articles
Browse All 13 View Live




Latest Images