I know I can use the AddUniverse and set the resolution to Daily to load a set of symbols each day. However, what if the set of symbols I want to load isn't available until 4am (instead of midnight when AddUniverse gets called again)?
Would it be more appropriate to do something like:
Schedule.Event().EveryDay().At(4,0)
and within that method to call AddUniverse again to try load data up?
Or, would it be more appropriate to increase the resolution of AddUniverse (like very hr) and have that method check an (ick) global collection to see if data has changed and reload then?
Not sure I'm being clear, but hopefully someone understands my question. :) I can try to clarify if need be. Thanks.
Alexandre Catarino
If the universe is updated once per day, the more appropriate way it to set up a Custom User Defined Universe (see PreMarketDailyUsEquityUniverse class in the attached project), where you can define the exact moment the algorithm will poll for universe data. You probably want to make poll it a few minutes before the exchange is open to be sure no symbol is missing.
TedVZ
Thank you for sharing the sample! This looks like it'll help me understand more about universes and scheduling universe refreshes. Thanks!
Derek Melchin
Hi Cristian,
We can accomplish something similar in Python with a ScheduledUniverseSelectionModel, a class we have implemented to be a user-friendly solution to the above algorithm.
self.SetUniverseSelection(ScheduledUniverseSelectionModel( self.DateRules.EveryDay("SPY"), self.TimeRules.At(9, 20), self.SelectSymbols ))
See the attached backtest for reference.
Best,
Derek Melchin
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.
TedVZ
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!