EDIT: The updated version of this algorithm uses Q1500US, one of the pipeline's built-in filters. Lesson 11 from the Pipeline tutorial introduces these built-in filters and provides a brief explanation on how they are used to specify a downsized base universe. More detail on the selection criteria of these filters can be found here.
About a week ago Scott Sanderson posted about Pipeline's new support for string data, and included a notebook demonstrating how to narrow down the trading universe. These filters get rid of a lot of the equities that an algorithm generally shouldn't trade, like non-primary shares.
Specifically, there are nine filters, checking that the equity:
1. is a common stock
2. doesn't have a name indicating it's a limited partnership (LP)
3. doesn't have a company reference entry indicating it's a limited partnership
4. has fundamental data associated with it in Morningstar (isn't an ETF)
5. isn't over-the-counter
6. isn't When Issued
7. isn't a depository receipt
8. is primary share
9. has a high dollar volume
Pipeline is a powerful tool that opens up access to the full range of 8000+ equities in Quantopian's database. This includes a wide variety of types of equities, including ETFs, ADRs, non-primary shares, etc. Different types of equities can behave differently or have different data available. For example, ETFs don't have fundamental data. As a result, a model can be heavily dependent on the types of equities that it's using. These filters can help select the types of equities that you want to trade.
We wanted to draw some attention to these filters, since this type of security selection is a best practice we recommend. I've attached an example mean-reversion algorithm that makes use of the filters, and selects from a generic set of liquid and common stocks. Clone this algorithm and try using these filters in your own strategy!