I'm looking for example code to screen a list of stocks to exclude ones that don't trade (e.g. due to de-listing) over the entire span of a backtest. Any ideas?
I've been running into a problem that my algorithm will buy a stock, but then not be able to sell it because it becomes inactive (for example, see https://www.quantopian.com/posts/market-closed-gap-trade). So, I'd like to exclude those stocks that are not listed over the full range of dates of the backtest (e.g. SNK).
Thanks,
Grant