Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
get all symbols under given index

Likely a dumb question but got no clues from docs. Assume I want to have the list of all symbols SP500, how can I get this? I am digging in the get_fundamentals(...) but the possible key/values for queries seem not documented yet

10 responses

Davide,

I don't think the data are available, unless Quantopian has added them. The same is true for other indices. What are you trying to do?

Grant

well, exactly what I said, instead of writing manually a list like symbols("FB","GOOGL","MA", ...) I'd like to populate with some sort of query.

You'd have to get the list of S&P 500 stocks yourself, at every point in time. And then incorporate it into the backtester (or research platform). Quantopian will not supply such a list.

ok, thanx

Davide,

Note that you may be able to replicate certain indices with good fidelity using get_fundamentals. For example, you can select stocks traded on Nasdaq and then sort and filter by market cap. You could then compare the performance of the portfolio with QQQ, for example, which tracks the Nasdaq 100. There are some subtleties, I'm sure, so have a look at http://www.nasdaq.com/markets/indices/nasdaq-100.aspx.

Grant

Grant, this brings to my original question, I guess I can with get_fundamentals but cannot understand which are the keys and the values to build a query. The example in the doc does not help too much

Here's an example. I'm no expert on get_fundamentals but this gives a flavor. I don't know why the portfolio doesn't track QQQ more closely. --Grant

Thanks, this is a good starting point.

Davide, this notebook should help you simulate the index constituents: https://www.quantopian.com/posts/simulating-s-and-p-500-russell-1000-russell-3000-in-research

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.