How can I get a Universe consisting of all stocks which are part of common indices, such as SPY, or Nasdaq100?
symbols = [ Symbol.Create("SPY", SecurityType.Equity, Market.USA) ]
# set algorithm framework models
self.SetUniverseSelection(ManualUniverseSelectionModel(symbols))
Only selects the SPY etf.
This should be a standard problem, but I could not find anything in the examples.
Gurumeher Sawhney
Great to see you're using the algorithm framework! The algorithm framework breaks down designing a strategy into Universe Selection, Alpha Creation, Portfolio Construction, Execution and Risk Management. Universe Selection, lets you select a universe with self.SetUniverseSelection(_universe_selection_model). In the code above you selected the manual selection model, which provides a fixed amount of assets. That is the reason why SPY is the only selection. Changing the model to the fundamental selection model will allow you to determine the universe off of coarse price and fundemental data. The bottom link shows an implementation of this very similar to what is trying to be achieved. Note that this is one of a few models that will be needed for the algorithm framework to work.
Filib Uster
Thanks for your help, but I don't really get it. Is there no simple way to set all stocks contained in the S&P500 as trading Universe?Â
Filib Uster
Sorry - I just found out that you have massively improved the Algorithm Framework environment. The project wizzard is especially helpful and provides among many others a template for QC500-Universe selection.
Kudos!
Halldor Andersen
Hi Filib.
The index composition for the S&P 500 and other common indices are not available yet. However, you can use the custom universe selection model QC500, which closely mirrors the composition of the S&P 500.
For further information, check out this documentation section on Universes and also this QC500 example algorithm.
Filib Uster
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!