I am testing a Forex strategy in Daily resolution but I am unable to reproduce the results I have in Tradingview (both OANDA). Comparing the bar data, I do see differences mainly in open or close data (high and low are correct).
My first attempt was to look if there are time zone issues. The timestamp in history is 19:00 for whatever reasons. I tried to adjust this by doing a 2 hour timeshift but the values remain the same.
After 2 days back and forth I have no idea how to fix it. I appreciate any advice.
Mia Alissi
To address the discrepancies in Forex data between QuantConnect and TradingView, here are some steps you can take:
Set the Algorithm Time Zone: Ensure that your algorithm's time zone matches the time zone used in TradingView. You can set the time zone in your QuantConnect algorithm using the
set_time_zone
method. For example, if TradingView uses UTC, you can set it like this:Check Data Time Zone: Verify the time zone of your Forex data. You can use the
GetDataTimeZone
method to confirm the data time zone. This will help ensure that the data timestamps align with your expectations.Data Normalization: Investigate any data normalization settings that might affect the open and close prices. Use the
SetDataNormalizationMode
method to adjust these settings if necessary. For Forex, you might want to ensure that the data is in its raw form without any adjustments:Resolution and Market Hours: Ensure that the daily resolution in QuantConnect corresponds to the same daily period as in TradingView. Forex markets operate 24 hours, but the daily bars might be constructed differently based on the data provider's settings.
Exchange Time Zone: Confirm the exchange time zone settings for the Forex pairs you are trading. This can be done by accessing the exchange's time zone property:
Custom Data Adjustments: If you apply any custom data adjustments or transformations in your algorithm, ensure they are consistent with those in TradingView.
By following these steps, you should be able to align the data more closely between QuantConnect and TradingView. If discrepancies persist, consider reaching out to support for further assistance.
Sources: Time Zones - QuantConnect.com, Handling Data - QuantConnect.com, US Equities - QuantConnect.com, FOREX Data - QuantConnect.com, Data Preparation - 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.
Steffen Heinrich
Ok, but i expected that open and close time for daily bars is handled in the background correctly. This is what I understood from the announcement from June 2024 “PRECISE MARKET OPEN AND CLOSE FOR DAILY DATA”?
Alexandre Catarino
Hi Steffen Heinrich ,
QuantConnect daily data are consolidated from midnight to midnight (UTC for FOREX), whereas FOREX is consolidated from 5 PM EST to 5 PM EST. The second example in the Calendar Consolidators shows how to generate daily bars that match other sources.
Best regards,
Alex
Steffen Heinrich
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!