Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Understanding Returns()

Hi, I'm a newbie and as a practice exercise I'm trying to build a simple momentum strategy. Specifically I'm trying to rank stocks according to the returns they had from the previous 25 days . However I noticed that Returns() doesn't seem to be doing what I expected it to do. Regardless of whether I calculate returns manually with pandas using natural days or business days I'm getting different results.

There's a short notebook attached with what I did to show you histograms of discrepancies.

Any ideas on why I'm getting different results with pandas?

1 response

Hi Pablo, I've attached a notebook which may help you in your research. I've shown two methods for retrieving 25D returns using the built-in RETURNS() method and the other using USEQUITYPRICING.CLOSE