I would like to generate a factor for equities based on some fundamental data, the problem is: the calculation uses current values minus values from five years ago. When I try to write a CustomFactor to do this with a window size of 1260 days I get a MemoryError, even when I mask out all but the US500 equities I still get that error. With 500 days is about the largest value that can be used and even it is very slow.
The fundamental data does not change that often, I would be happy with four data points a year. Is it possible somehow to downsample the fundamental data so that I can get 5 years worth of data?
Thanks for the help