Hi,
Does anyone know how to consolidate Minute future data into daily future data based on trading hours (i.e. 6 pm EST to 5 pm EST the next day, adjusted for holidays or short trading days if applicable)
I have tried the 2 options below and it only consolidates data based on actual time. (i.e., 00:00:00 - 00:00:00 next day)
# option 1
self.Consolidate(self.es.Symbol, Resolution.Daily,
self.DailyConsolidate)
# option 2
consolidator_daily = TradeBarConsolidator(timedelta(days=1))
consolidator_daily.DataConsolidated += self.OnDataConsolidated
self.SubscriptionManager.AddConsolidator(
self.es.Symbol, consolidator_daily)
And I notice that in the Calendar, there is no Daily option. There are only Weekly, Monthly,
Can anyone teach me how to consolidate data based on trading hours?
Really appreciate the help in advance!
Xinmin Cai
I worked out a way to have this implemented. However, the first day in the backtesting is off a little bit as the data feed starts from midnight. Hope someone else has a better way to implement this. And if anyone sees any issue, would appreciate it if you could let me know.
Xinmin Cai
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!