Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
0 Day holding Returns in pipeline.

Is it possible to add returns to a pipeline that reflect the holding period return from the close on the day before to the close on the date of that observation. For instance, I have a pipeline with earnings surprise dates, say on Jan 15th, and I would like to add the return from buying on the close of Jan 14th and selling on the close of Jan 15th.

When I use the following code:

returns = Returns(window_length=2)

I obtain the return from buying Jan 13th and selling Jan 14th.

The actual compute forward function gives me the returns of buying on Jan 15th and selling on Jan 16th.