Hi everyone, my code has a lot of stocks in its universe, probably 6000 or more, and in OnSecuritiesChanged, I have a history call that looks back 50 data points at Resolution.Minute.
I understand that universe selection runs between 4 am to 7 am in live trading, and I understand that currently there is no way to schedule universe selection for live trading, and also, that history calls take a relatively large chunk of time, especially in my case because I'm making a history call for 6000 stocks.
So here's my question, what happens when my algorithm is running its logic between 4 am to 7 am and universe selection happens at the same time? For example, if logic is running between 4 - 4.30 am, and universe selection happens at 4.30 am, will it just stop running its logic? What if new data is being pumped in to OnData while it is running universe selection?
Varad Kabade
Hi Li Cheng,
The logic won't be interrupted during the above scenario. Once the logic is completely executed, the Universe selection data will be streamed into the algorithm.
Best,
Varad Kabade
Li Cheng
Hi Varad, thank you so much for the explanation!
Just to clarify, you're saying that universe selection runs separately from the logic of the algorithm, hence, it does not require the main, I guess, Python processor (?), to process the universe selection criteria, hence, my universe will be updated once the algorithm finishes running its logic instead of having Python to choose whether to process universe selection first or run its logic first.
Varad Kabade
Hi Li Cheng,
Yes, you are right.
Best,
Varad Kabade
Li Cheng
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!