It appears that I can not load extended market hours in a research notebook, is this true?
This works fine in an “Algorithm Lab” notebook:
import datetime as dt
qb=QuantBook()
start_date = dt.datetime(2020, 1, 2) # Adjust the start date
end_date = dt.datetime(2020, 1, 3) # Adjust the end date
symbol = qb.AddFuture("ES").Symbol
resolution = Resolution.Minute
data = qb.History([symbol], start_date, end_date, resolution)
But if I try to add the “includeExtendedMarketHours=True” parameter to the History call, it errors out.
Is there a way to use extended market hours in a notebook? I was hoping to train a model in the notebook, but it will require access to historical extended hours.
Sorry for the newbie question, hopefully someone can clear this up for me.
Thanks!
MikeJ
B9 Mike
Figured it out, I think.
Use GetFutureHistory and set extendedMarketHours=True
For future reference:
B9 Mike
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!