To make our modeling more realistic, our bars have two times—the start and end times. Other platforms tend to ignore this and have data without time, making modeling a multi-asset portfolio impossible. Markets close at different times, and ignoring this introduces look-ahead bias.
Previously, we represented daily data from midnight-to-midnight. This covered most cases but confused many people who expected to see the price data a day earlier. We've updated the start and end times of the bar to accurately reflect the market open and close times on a specific day—a new level of precision no other platform provides.
For example, in US Equity markets, Christmas Eve typically closes early. This is represented by a Time value of 9.30 am and an EndTime value of 1.00 pm, accurately reflecting the moment the bar was available. If you were trading another asset, such as FX, which might close at 5.00 pm on Christmas Eve, the FX daily bar would arrive at 5.00 pm later that day.
These timezone and market-hour-aware daily bars will soon be the default behavior for the platform. Because it is a significant change, we're rolling this out as an optional feature for the next few weeks before making it the default behavior. To opt-in and test the new timed bars early, please use the following algorithm setting:
# Python
self.settings.daily_precise_end_time = True
# CSharp:
Settings.DailyPreciseEndTime = true;
After July 8th, this behavior will be the default, and to preserve the old timestamps, you will need to set this property to false. We hope this will help make it easier to compare QuantConnect daily data with third-party platforms, as the dates will line up rather than offset one day.
In live trading, the daily bars will arrive at market close (4.00 pm for US Equities) rather than midnight. If your logic relies on the previous midnight behavior, you may want to review it to be safe.
Happy Coding!
Team @ QuantConnect
Chetan Prabhu
This is great! Does this also mean that for backtesting, daily bars will emit at the time of close, or will they still emit at midnight?
Aaron Eller
This is a great update. Is there a way (other than using a custom calendar function) to take advantage of this with bar consolidators for equities? The goal would be that they also fire at the day's closing time rather than at midnight.
Jared Broad
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!