Hi everyone, i just stumbled in a trouble that i can't figure out: if i use hourly data for the pair EURUSD (FXMP) all the candles cooresponds to the ones that are showed in the tradingview charts, all the values (Open, High, Low, Close) corresponds in a perfect way; the problem is that when i consolidate the data into daily, there is no more correspondence with the data from the same tradingview chart of before (with daily timeframe).
The following is the code that i use to get daily candles from hourly ones, maybe i am missing something
# in Initialize() i build a 10 days rollingwindow consolidating from hourly data
self.dailywindow = RollingWindow[QuoteBar](10)
self.Consolidate("EURUSD", Resolution.Daily, lambda x: self.dailywindow.Add(x))
# in OnData() i use this code for printing the OHLC values to check them
if self.dailywindow.IsReady:
self.Debug(" daily OHLC {0},{1},{2},{3}, ".format(self.dailywindow[0].Open,self.dailywindow[0].High,self.dailywindow[0].Low,self.dailywindow[0].Close))
since i am implementing a two-timeframe strategy it is important that the both hourly and daily data are consistent with FXMP official data (that i look at from tradingview)
Any kind of help or feedback would be appreciate ;)
Shile Wen
Hi Bronx,
If you could attach a backtest, as well as a couple of days of daily data from TradingView, it would make it easier for us to assess this issue. However, for now, one idea is that because the values aren’t printed with self.Debug until the RollingWindow is full, the candlestick/bar data is print on a 10-day delay, which can be fixed by adding self.SetWarmup(10) inside the Initialize method.
Best,
Shile Wen
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.
Bronx verzio
Thank you for the answer Shile Wen,
i attach the project and the backtest. It contains the way in which i consolidate the candles and print them with debug, so that is easy to retrieve from the log file the OHLC values for each day to compare with tradingview in no time.
I tried self.SetWarmup(10) but the values don't match yet.
could it be a matter of timezone?
Regards,
Bronx
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.
Jared Broad
Randall Cooper's reply is spot on -- we use GMT days, not eastern-time days which makes the daily data slightly different to some other platforms. At this point, it would break a lot of people's algorithms to switch the aggregation period so it's difficult to migrate it across.
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!