I'm trying to develop a value oriented algorithm where I want to drop all stocks that were listed within a certain period since the IPO date. I can't seem to get a custom factor working right that gets the age in days of a stock. Here's what I tried...
class StockAge(CustomFactor): inputs = [morningstar.share_class_reference.ipo_date] window_length = 1 def compute(self, today, assets, out, ipo_date): delta = today - ipo_date[-1] out[:] = delta.days
But I can't seem to add this to my pipeline. I get an error when I do so. Could someone please suggest how I could do this?