Hi;
So I put a test to make sure my data is loaded in OnData and return immediately if it has not.
When the load completes, will OnData fire? And if not, is there some way to force either a timer method to be called in 1 minute or to tell it to call OnData in 1 minute?
I don't like the idea of returning and then waiting some random time until some data event occurs when I want to start my OnData processing ASAP/
thanks - dave
David Thielen
I believe the answer to this is no. OnData fires when the data you are tracking adds another slice based on the period for the data.
Alexandre Catarino
Hi David Thielen ,
Please note that QuantConnect/Lean is event-driven, so the QCAlgorithm methods won't be triggered if there is no event.
OnData is fired when there is a data event, market data, corporate event (split, dividends, symbol change). or custom/alternative data event. The first OnData call will happen when we have the first data point after the algorithm StartDate or the warm-up start date if we use the SetWarmUp method. In the first OnData call, not all securities may be present, even with fill data forwarded, because there is no past data to fill forward. Normally, after the first data point of each security has arrived, all Slice objects will have data for all securities.
Best regards,
Alex
David Thielen
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!