Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Efficient way to get periodic data

Hi, in one of my factor, I like to get a set of periodic data, by that I mean, say today is Sep 2 and I like to check how well a given stock was trading in the past 8 years given a window of 20 days:

from 2019-09-02 to 2019-09-27
from 2018-09-02 to 2018-09-27
from 2017-09-02 to 2017-09-27
...... from 2012-09-02 to 2012-09-27

What I do right now is to set a window length of 8 year long and assign date to each row then get the rows I need. By running Cheng Peng's optimization procedure (https://www.quantopian.com/posts/new-video-learn-from-the-experts-ep-5-alpha-factor-optimization-with-cheng-peng), it becomes very slow, as compared to running on research/IDE.

1 response

Is it possible to get historic data inside a custom factor? or as input to a custom factor?