Hey,
I'm trying to apply a Scheduled universe selection using fundamental data,
for the simplicity, I want to perform the QC500 fundamental universe selection every Sunday, and generate alphas for this universe for the next week,
In the next week, it will work with new screened stocks.
Exploring the API,
scheduled selection, I want to perform it once a week, when markets are closed :
self.SetUniverseSelection(ScheduledUniverseSelectionModel(
self.DateRules.Every(DayOfWeek.Sunday),
self.TimeRules.At(12, 00),
self.SelectSymbols
))
while QC500UniverseSelectionModel (class object;FundamentalUniverseSelectionModel's -child) should be formatted like like SelectSymbols(function)
QC500UniverseSelectionModel(FundamentalUniverseSelectionModel)
def SelectSymbols(self, dateTime)
I can see that for Fundamental filtering I declare
FineFundamentalUniverseSelectionModel(self.SelectCoarse, self.SelectFine)def SelectCoarse(self, algorithm, coarse)
def SelectFine(self, algorithm, fine):
examining those functions, I can see that SelectCoarse perform data analysis on coarse input
filtered = [x for x in coarse if x.HasFundamentalData and x.Volume > 0 and x.Price > 0]
and returns self.symbols which is just a list of symbols[ strings I guess?], then SelectFine input uses fine to perform the next filtering with some verifications in the class.
Is there a simple way to what I want to do?
Ofir Shmulevich
v
Link Liang
Hi Ofir,
Here is my attempt of implementation: define a week counter self.week, and use it to ensure the universe selection only runs once every week (at the beginning of the week). It follows the same implementation of our QC500UniverseSelectionModel.
By default, universe selection occurs before market open everyday. Currently we don't support immediate universe selection. Besides, the result of selection on Sunday noon would be the same as the result on Monday morning, since the data has not changed.
Because 1000 tickers are involved in fine selection, the running speed is expected to be relatively slow. To increase running speed, you might want to select less symbols or run universe selection less frequently.
Hope it helps.
Ofir Shmulevich
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!