Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Help referencing a security return at a previous time point

Hello,

I am fairly new to Quantopian and Python programming, and I am trying to create a custom factor that computes the return of a security (e.g (Close @ t+1 - Close @ t) / Close @ t) but where time t is for example 3 bars behind the current bar. Essentially I am trying to say "if security XYZ has a positive return at t-3, order (details)." However to do this I need to create the custom factor that computes if XYZ is positive or negative at t-3, which is where I could use some help.

Thank you!

Hershel