Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to filter out the foreign company securities?

Since I just want to trade american companies.

2 responses

Thomas,

Take a look at the attached notebook. You can create custom filters based upon any of the Quantopian data sets. I've used the Morningstar data set and filtered for 'is_depositary_receipt' and 'headquarter_country'. If you want just companies with headquarters in the USA then the 'headquarter_country' works best. See the comment for how to change the filter and get different results.

You can use the same custom filter classes and logic in algorithms.

You may also want to look at this post https://www.quantopian.com/posts/pipeline-trading-universe-best-practice to further filter your trading universe to a realistic subset.

Many thanks!