When subscribed to a single symbol, why is OnData() being called for a date when no data is available?
For example, for AAPL on 2020-08-31, OnData() is being called but there was no trade on 2020-08-30 since the markets were closed.
Also, how would we distinguish this case from the case where a data bar is really missing and therefore we might have to eliminate that symbol from our universe for a while since the indicators will not be accurate?
Varad Kabade
Hi BeachFront,
The Slice event handler(OnData) combines all of the data into a single method. The data may contain Trade bars, Quote bars, Splits, Dividends, and Delisting events. The information about splits and dividends is passed at midnight; hence the OnData event handler is called to notify about Splits and Dividends.
Also, how would we distinguish this case from the case where a data bar is really missing, and therefore we might have to eliminate that symbol from our universe for a while since the indicators will not be accurate?
The algorithm will take care of the above scenario, i.e., the slice object will not contain TradeBars(if the fill forward is false). Refer to the attached backtest.
Best,
Varad Kabade
BeachFront
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!