My strategy I work requires yesterday daily closing price of S and P 500 E Mini. I get significant amount of discrepancy compare to CMEGroup historical data. I know Quantconnect made some adjustment to price. I tried different arguments to addFuture but difference get larger. I want to be as close as possible to CMEGroup historical data.
Mia Alissi
Based on the provided code and the information from the knowledge sources, it seems that 'Ross' is using the
AddFuture
method correctly to add the S&P 500 E-Mini futures to the algorithm. However, the discrepancy in the closing prices compared to the CMEGroup historical data might be due to the data normalization mode used by QuantConnect.QuantConnect uses the
DataNormalizationMode
to adjust the raw data. The default mode isAdjusted
, which adjusts the raw data for splits and dividends. This might cause discrepancies when comparing with other data sources.In the case of futures, the
DataNormalizationMode
can be set toBackwardsAdjusted
orRaw
. TheBackwardsAdjusted
mode adjusts the prices to mimic a continuous contract, while theRaw
mode uses the raw prices without any adjustments.If 'Ross' wants the raw prices without any adjustments, he can set the
DataNormalizationMode
toRaw
when adding the future. Here is how to do it:However, it's important to note that different data sources can have different close prices, which can impact the final results of a backtest. This is due to the fact that each data source may capture different aspects of the market. For example, some data sources may capture high frequency, low volume flickers that some retail providers don't capture. This can lead to differences in the reported prices for the same asset at the same time (source).
If 'Ross' continues to observe significant price discrepancies, it might be worth running a backtest on QuantConnect and comparing the result of
self.History
with the same data from another source. This can help him understand where the differences are coming from. If the discrepancies persist, I would recommend posting a detailed question on the QuantConnect forum with specific examples. The community there may be able to provide further insights.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.
Eric Waschenko
Hi Ross,
Did you manage to find a solution to this? I'm experiencing the same issue. Â Comparing ES & NQ QuantConnect Data to other providers data from May 1 - Jun 30, 2023. The Open values were never the same, High was the same 26 / 43 days, Low was the same 25 / 43 days and Close was the same 2 / 43 days
Ross Castroverde
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!