Hi, 

I'm trying to consolidate minute data into 4H bars aligned with the regular OANDA exchange hours.

For example, I'd like the 4H bars to consolidate for 17:00, 21:00, 01:00, 05:00, 09:00, 13:00, etc.

I've followed Louis Szeto's example given in the following thread:

You can find my implementation in the attached backtest.

However, the logging of said backtest gives the following:

2024-05-27 00:00:00 : Algorithm starting warm up...
2024-06-02 17:04:00 : 2024-06-01 00:01:00 - EURUSD H4 Consolidated. EndTime: 2024-05-31 20:00:00
2024-06-02 17:05:00 : Algorithm finished warming up.
2024-06-02 21:03:00 : 2024-06-02 21:03:00 - EURUSD H4 Consolidated. EndTime: 2024-06-02 21:03:00
2024-06-03 01:03:00 : 2024-06-03 01:03:00 - EURUSD H4 Consolidated. EndTime: 2024-06-03 01:03:00
2024-06-03 05:03:00 : 2024-06-03 05:03:00 - EURUSD H4 Consolidated. EndTime: 2024-06-03 05:03:00
2024-06-03 09:03:00 : 2024-06-03 09:03:00 - EURUSD H4 Consolidated. EndTime: 2024-06-03 09:03:00
2024-06-03 13:03:00 : 2024-06-03 13:03:00 - EURUSD H4 Consolidated. EndTime: 2024-06-03 13:03:00
2024-06-03 17:04:00 : 2024-06-03 17:03:00 - EURUSD H4 Consolidated. EndTime: 2024-06-03 17:03:00
2024-06-03 21:03:00 : 2024-06-03 21:03:00 - EURUSD H4 Consolidated. EndTime: 2024-06-03 21:03:00

My question is: Why is the consolidated data coming through at 3 minutes past the desired time, and how can I make it consolidate appropriately, e.g., the EndTime of the consolidated bar is precisely on the 4H increment?

Many thanks in advance.