Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How can I filter securities based on the Exchanges they are available on?

Before I found Quantopian, I had produced some strategies using www.profitspi.com. I am now trying to translate a strategy from there, to code on Quantopian.

The struggle I am having is that one of the filters was based on the Exchange a security might be available on. IE. NYSE, NYSE Arca, Nasdaq CM/GM/GS for example. I have no clue how to make this work for Quantopian. Any ideas? would the Q500, or Q1500 most likely produce similar universe results? Is there a part of the morning star data that would give the exchange info?

Many Thanks!

1 response

The exchange that a security trades on (stocks only) can be found in the morningstar dataset.

exchange = mornigstar.share_class_reference.exchange_id.latest

See https://www.quantopian.com/help/fundamentals#share-class-reference and https://www.quantopian.com/help/fundamentals#exchangecodes

One can make a filter to get only specific exchanges by doing something like this

my_exchanges = exchange.element_of(['NYSE','NYS','NAS'])

Note that the New York Stock Exchange was changed from NYSE to NYS sometime along the way by Morningstar.

Hope that helps.