Back to Community
Filter Pipeline by duration of publicly trading

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.

2 responses

One can look at the data field Fundamentals.ipo_dateto 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.latestwithout 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?

Loading notebook preview...

Thank you. It is an efficient way to achieve it!