Hi all.
I am tying to get hourly bars history for GC in a notebook.
I am using add_future and history methods.
I get bars from 10am to 5pm, so not 23hrs negotiation.
I tried to set also extended market hours to True but it doesn't change. Why?
Is there any solution? Should I get minute bars and consolidate them in hours bar?
I found several old posts that said to use get_future_history or GetFutureHistory but i assume it is deprecated now.
Mia Alissi
To achieve extended market hours for hourly-resolution data in futures trading on QuantConnect, the following approach is recommended:
Use Minute Resolution with Extended Market Hours: When adding a future to your algorithm, using
Resolution.Minute
will ensure access to extended hours data. Here's how to do it:Consolidate Minute Bars to Hourly Bars Manually: Since direct requests at an hourly resolution with extended hours don’t provide the complete data range, manually consolidating minute data into hourly bars is necessary. Follow this sample method:
By using minute-level data and manually consolidating it, you gain access to extended hours data consolidated into hourly bars for analysis or backtesting. This technique overcomes the limitations of direct hourly resolution requests, as extended hours are typically not included in such requests.
Sources: Basic Template Futures With Extended Market Hourly Algorithm, Key Concepts - QuantConnect.com, Calendar Consolidators - QuantConnect.com, Futures - QuantConnect.com, Future Contracts Extended Market Hours Regression Algorithm
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!