Been working on this for a few days and read many posts and sample code. My 5 min consolidator seems to be working fine in SymbolData. I created a 1 day consolidator in DaySymbolData (looks pretty ugly) but it does not seem to get data. I tried different warmups.
As an aside, it worked fine when I created a manual universe, but when using coarse and fine filters, it does not seem to work.
What am I missing in the DaySymbolData class? Any help or sample code would be greatly appreciated. I have a Debug statement in OnData that never gets hit.
Cole S
Try using the Consolidate methods on the QCAlgorithm class. Something like:
self.algorithm.Consolidate(symbol, timedelta(days=1) self.OnDataConsolidated)
This will return an IDataConsolidator type.
Frank Goddard
Thanks for the response and suggestion. I added that line in my DaySymbolData and commented out some other lines that probably should not be there. However, my Debug line in OnData is still not getting data. Any other thoughts? Backtest attached.
Cole S
Both of your consolidators are working fine (either way) and that does not appear to be the issue. I stepped through debugging and you are never getting past:
# Make sure indicators and rolling windows are ready if not all([symbol.IsReady for symbol in self.symbols.values()]): return if not all([symbol.IsReady for symbol in self.daySymbols.values()]): return
I think the issue is that your universe is adding new symbols every day or two so you always have symbols that have not warmed their data up and are failing the IsReady test.
You need to change the code above and just exclude unready symbols from trading or do some history calls to warmup the data on when the security is added.
Frank Goddard
Thank you. Very insightful. WarmUp and IsReady have been very confusing for me. Also, I realized I did not need to do a Universe selection every day. Just at the beginning of my algorithm and this also helped to alleviate the data not being ready.
Frank Goddard
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!