Is there a simple way to filter some of the universe of stock proposed as QTradableStocksUS by the effective period in which a company has been listed? For instance, I am trying to select only stocks that have been traded for at least 36 months.
Is there a simple way to filter some of the universe of stock proposed as QTradableStocksUS by the effective period in which a company has been listed? For instance, I am trying to select only stocks that have been traded for at least 36 months.
One can look at the data field Fundamentals.ipo_date
to determine how long a stock has traded. There isn't a good way to tell what 'today' is within the pipeline definition so one needs to create a custom factor. The parameter 'today' passed to the compute method contains the current backtest day. One could also simply use Fundamentals.ipo_date.latest
without a custom factor but then do the date comparison in the algo once the pipeline results are returned.
See attached notebook. Is that what you were looking for?