Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Historic data within certain time frame

I am looking to retrieve historic data inside my customfactor. Given today as a date, I want to get the pricing data of past N years that cover a window of X. Basically I want a dataframe of a subset of close with dateindex as its index

Say today is 2019-11-17, if N=2 and X =3 then here are the prices dated as follows:
2017-11-17
2017-11-18
2017-11-19
2018-11-17
2018-11-18
2018-11-19

If I understand correctly, all price series inside a customefactor are in the form of ndarray, no dateindex associated with. Any thought?