Why is my self.History(1, Resolution.Daily) giving me 12-17 when the log shows 12-19? I have attached a debug to see in the log for reference.
I know that my start date is 12-18, but the log doesn't throw the debug until 12-19 (also - why not 12-18?) so shouldn't my debug with self.time[-1] for self.History return 12-18 in that case?
Any help would be greatly appreciated!
Enzo Ferrari
Here is a snip of the log that I am referencing -
Alexandre Catarino
Hi Enzo Ferrari ,
When the algorithm subscribes to Daily data and schedules an event, this event can be triggered as a "past event". For example, when data from 20181219 00:00 is streams through the algorithm, the event is triggered at 20191218 09:31. It is a resolution particularity that can be solved by subscribing to minute-resolution data.
At 20191218 09:31, the algorithm makes a historical data request for daily resolution. The last data available closes at 20191218 00:00. The variable that the algorithm is (opening) Time while it should be closing time (EndTime).
for slice in history: bar = slice[self.syl] self.open.append(bar.Open) self.close.append(bar.Close) self.high.append(bar.High) self.low.append(bar.Low) self.volume.append(bar.Volume) self.time.append(bar.Time) self.Debug(f"{self.Time} -> {self.open[-1]}: {self.close[-1]}: {self.high[-1]}: {self.low[-1]}: {self.volume[-1]} {self.time[-1]}")
Enzo Ferrari
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!