I run open source LEAN on my local env. and I'm trying to import a market whose trading hours span two days, e.g, the trading day 21 June starts from 21:00 20 June and ends at 15:00 21 June. If I consolidate the minute bars to daily ones, or when I add an indicator with daily resolution, I expect that all the minute bars from 21:00 20 June to 15:00 21 June are calculated to one daily bar for trading day 21 June, rather than having two daily bars 20 June and 21 June.
I see there is MHDB which defines the trading hours for each week day, but such information may not be able to help LEAN understand a trading day in fact spans two "calendar" days. What is the best way to implement the above scenario?
Louis Szeto
Hi Laye
Please refer to the CalendarInfo Periods section of Time Period Consolidators docs. It'll guide you on how to set up your “specific hour” consolidation.
Best
Louis
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.
Laye
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!