I'm using the following code to get ES historical data.
es = qb.add_future(Futures.Indices.SP_500_E_MINI, Resolution.DAILY).symbol
es_history = qb.history(es, 30, Resolution.DAILY)
What I found is that there're a lot of discrepancies between the data returned and values on TradingViews or IBKR. For example, the values QuantConnect returns ES on 06/18 OHLC are [6045.0, 6073.75, 6026.25, 6036.0], whereas TradingViews got it as [6030.75, 6073.75, 6017.75, 6034.25]. Is there some arguments I need to use in qb.history to get the right results?
Also 06/19 is a US holiday. Why does QuantConnect still returns values for this day?
Mia Alissi
Here’s an improved approach for fetching ES (S&P 500 E-mini Future) historical daily data in QuantBook that better matches exchange official OHLC and removes spurious bars returned for holidays like Juneteenth:
Key points:
fill_forward=False
andextended_market_hours=False
provide the cleanest official session bars, minimizing artificial fills or after-hours influences.us_holidays
as needed.Let me know if you need to automate the holiday-list (using Python's
holidays
library or QuantConnect's trading calendars)!Sources: Pre Holiday Effect, Upcoming Holiday Momentum for Amazon, Futures Fast Trend Following, with Trend Strength, Key Concepts - QuantConnect.com, Futures - QuantConnect.com
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.
Moho wu
Using fill_forward=False and extended_market_hours=False doesn't change anything.
So QuantConnect doesn't exclude holidays by default and I have to manually remove them?
Moho wu
I just consolidated the hourly data to daily OHLC for a single day. QuantConnect's data is consistent while Trading View is not. The hourly data for QuantConnect is consistent with Trading View's. But something odd is happening when Trading View consolidates high resolution data into Daily OHLC, hence the discrepancy. Still not sure why QuantConnect has data for 06/19 for ES though as it's a US holiday.
Moho wu
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!