Hello, I am using consolidator with timedelta(days=1) with ETHUSDT on Binance data with Minute resolution. However, for some reason consolidator bars appear at 19:00 or 20:00 (depending on the summer time I guess), not at 0:00. I tried to fix this with custom consolidator like this:
# consolidator
consolidator = TradeBarConsolidator(self.CustomConsolidator)
consolidator.DataConsolidated += self.OnBar
algo.SubscriptionManager.AddConsolidator(symbol, consolidator)
def CustomConsolidator(self, dt):
period = TIMEFRAME
if period >= timedelta(days=1):
start = dt.replace(hour=0, minute=0, second=0)
return CalendarInfo(start, period)
But it doesn't affect anything (in debugging, it gets dt at 19:00/20:00, replaces start correctly and returns it, however, it doesn't change anything). It seems I am missing something? How do I make the consolidator to consoldiate prices at 0:00?
Derek Melchin
Hi Yuri,
With the custom consolidation period method above, the consolidator creates bars that span 00:00 UTC to 00:00 UTC the following day. The consolidation handler is called at 00:00 UTC, which is 19:00/20:00 New York time. If we check the start and end times of the consolidated bars, we can see that they span from 00:00 UTC to 00:00 UTC the following day even though the algorithm time is 19:00/20:00. To get the algorithm time to say 00:00 when the consolidated bar is sent to the consolidation handler, set the algorithm time zone to UTC.
See the attached backtest for reference.
Best,
Derek Melchin
Want to invest in QuantConnect as we build the Linux of quant finance? Checkout our Wefunder campaign to join the revolution.
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.
Yuri Lopukhov
Oh, I see, but in the orders list orders still show New York time it seems, even if I set UTC as time zone (I've added SetHoldings on first call):
 If I export orders, in CSV time zone is correct:
this is a bit misleading I guess, maybe worth fixing in QuantConnect UI?
Derek Melchin
Hi Yuri,
We note the time zones of these timestamps in Orders.
Best,
Derek Melchin
Want to invest in QuantConnect as we build the Linux of quant finance? Checkout our Wefunder campaign to join the revolution.
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.
Yuri Lopukhov
Derek Melchin The best documentation is when it is not required you know…
Yuri Lopukhov
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!