In def CoarseSelectionFilter(self, coarse):, what is the "coarse" object within the() exactly? As far as I understand, it's a pre-made list containing all the stocks available to filter through, right? What would I have to do if I want to start with a basket of technology or energy stocks instead of a basket of all 6000+ stocks and then filter through that? Is there another object I can replace "coarse" with? What if I want to start with a pre-made list that I made myself, and have the def CoarseSelectionFilter() function filter through that pre-made list instead?
Arthur Asenheimer
ManualUniverseSelectionModel should fit your needs. You can find an example here.Â
Vncne
Hi Arthur; in here, they showed an example of using technology stocks as the initial basket to filter on:
Here
self.SetUniverseSelection(TechnologyUniverseModule())
Do I make use of this module the same way as if it were:
self.AddUniverseSelection(LiquidValueUniverseSelectionModel())?
Â
Also what's the difference between "AddUniverseSelection" and "SetUniverseSelection"?
Thank you
Arthur Asenheimer
In this case SetUniverseSelection and AddUniverseSelection will do the same. I think the difference between the two version is that AddUniverseSelection is able to handle multiple Universes. That's why I'd prefer AddUniverseSelection.Â
Shile Wen
Hi Vncne,
Another way to choose and filter through tech stocks would be by using a fine filter, and this BootCamp is a great resource on how to do this. Furthermore, to filter the coarse using our custom list of tickers, we can iterate through coarse to see if the ticker is in our list using this line: coarseMyTickers = [c for c in coarse if c.Symbol.Value in tickers_list]. To see how to do this, please the attached backtest.
Best,
Shile Wen
Vncne
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!