Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Basic Question on the context object

Hi Guys,

I have a basic question about the context object. Currently I have a property called stocks which is an array containing 5 stocks. I have manually keyed in sid of each stock.
Now I want to move from 5 to all. Is there a to get the sids of all US Equities into this array programmatically? I dont want to hard code all of the sids

4 responses

Someone please correct me if I'm wrong, but I believe you are limited to only 10 sids at the moment.

If your goal is to create a strategy for "all" US Equities, why not use an ETF? For instance, SPY (sid 8554) represents the S&P500.

Hi,

Alex is right, but we will be shipping a tool to let you take a large sample of stocks based on their dollar volume traded, without specifying individual securities. The method we will be using is explained in this post: https://www.quantopian.com/posts/universe-selection

thanks,
fawce

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.

Thanks so much guys appreciate it

Hello Fawce,

Has Quantopian thought about making a distinction between backtesting and screening? For screening, why not give members access to the entire database and an appropriate tool set for analyzing it?

Gotta run...I'll provide more feedback as time allows.

Grant