I recommend combining a
QTradableStocksUS() filter with a market cap filter like
MarketCap().top(500) to create trading universes that suit your needs, as opposed to replicating indexes like the S&P500.
Creating a trading universe on the Quantopian platform requires creating and combining pipeline filters. It looks like you understand how to create filters. To learn more about combining filters, check out this lesson of the Pipeline API Tutorial.
Recreating indexes can be difficult. For example, the S&P500's profile page offers a PDF detailing the criteria an asset must pass in order to be included in the index. As of today, that PDF is 41 pages long. Your pipelines look OK technically, and run successfully when I clone them, but you would have to write many more filters (and possibly provide some of your own data) to truly recreate all of the rules that govern a fund like the S&P500.
My recommendation is to augment the
QTradableStocksUS filter to suit your needs. For example, I have attached a notebook with a pipeline that outputs the close price of the 500 equities with the highest market cap values which pass the
QTradableStocksUS filter. The stocks that pass these two filters (large market cap, passes QTU) are mostly the same stocks that make up the S&P500.
Lastly, to enter the Quantopian Contest, or be considered for funding, an algorithm must use the
I hope this helps you and others who are trying to create trading universes. Please let us know if you have any further questions.
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.