Changing the daily cutoff changes which quotes belong to each D1 and H4 candle. We rebuild both candle grids from the same EUR/USD Bid and Ask records. Then we compare a simple closing rule and check which bars were already closed when the test made its decision.
In simple terms
Record the candle interval as well as the time displayed on the chart. Set a named time zone and a daily cutoff, rebuild both timeframes from the same source, and use only bars that close at or before the decision time.
On this page01
Define the candle interval
A candle describes an interval of prices. Include a quote at the opening boundary and assign a quote exactly at the closing boundary to the next bar. Store the opening and closing times separately. A bar's closing price comes from its last included quote, which can precede the boundary.
02
Build two daily grids
For each date from 8 to 11 July 2024, the UTC grid starts at 00:00 UTC on that date and ends at 00:00 UTC the next day. The New York grid starts at 17:00 America/New_York on the preceding date and ends at 17:00 local time on the named date. The New York panel labels bars by their local closing date.
03
Normalize the source clock once
We use the July 2024 HistData EUR/USD Generic ASCII tick archive. Its source timestamps use fixed UTC−5 all year. Convert them to UTC before assigning quotes to candles. Use the date-specific America/New_York offset separately to build the New York cutoff. Take each midpoint as the average of Bid and Ask.
04
Read the two D1 candles for a date
Each panel shows the same four labels on a shared price scale. Select a candle to read its actual UTC interval, prices and quote count. The labels let us compare daily aggregation choices. The two intervals under one date label start and end at different times.
D1 candles under two daily cutoffs
EUR/USD · HistData · 2024-07-08 → 2024-07-11
Midnight UTC grid
Start (UTC)
Open
1.082465
High
1.084505
Low
1.081470
Close
1.082580
Quotes
56,451
End (UTC)
2024-07-09 00:00
D1 · Close above open
Yes
17:00 New York grid
Start (UTC)
Open
1.080305
High
1.084505
Low
1.080265
Close
1.082510
Quotes
58,552
End (UTC)
2024-07-08 21:00
D1 · Close above open
Yes
The four labels match across panels. Select a candle to see its actual interval in UTC.05
Anchor H4 to the daily start
Each sampled day spans 24 hours, so divide it into six consecutive 4-hour slots from its start. The UTC H4 grid opens at 00:00, 04:00, 08:00, 12:00, 16:00 and 20:00 UTC. In this July sample the New York grid opens at 21:00 on the previous UTC date and then at 01:00, 05:00, 09:00, 13:00 and 17:00 UTC. The H4 panels compare equal slot numbers within each day label.
H4 candles anchored to the start of each day
EUR/USD · HistData · 2024-07-08 → 2024-07-11
Midnight UTC grid
Start (UTC)
Open
1.082610
High
1.083635
Low
1.081470
Close
1.082175
Quotes
7,768
End (UTC)
2024-07-08 08:00
H4 · Close above open
No
17:00 New York grid
Start (UTC)
Open
1.082560
High
1.083635
Low
1.081910
Close
1.083145
Quotes
7,700
End (UTC)
2024-07-08 05:00
H4 · Close above open
Yes
Each date contains six H4 slots in the sample. Matching slots can start three hours apart.06
Compare a closed-candle rule
For each completed candle, mark the rule true if its close is above its open. A close equal to or below the open gives false. The flag differed in 0 of 4 D1 pairs and 7 of 24 H4 pairs. These pairs use matching labels and slot numbers, so they can cover different moments.
C > O
07
Test both grids at the same decision time
On 9, 10 and 11 July 2024 we make a separate comparison at 22:00 UTC. For each grid use its latest nonempty D1 and H4 candles that close at or before the decision. On 9 July the UTC H4 uses 16:00–20:00 UTC and the New York H4 uses 17:00–21:00 UTC. Both panels show the same H1 candles. The shading identifies each selected H4 interval.
The H4 bars available at the same 22:00 UTC decision
Decision (UTC) · 2024-07-09 22:00Hours in the selected H4
Midnight UTC grid
Start (UTC)
Open
1.080925
High
1.081410
Low
1.080825
Close
1.081340
Quotes
2,084
End (UTC)
2024-07-09 20:00
H1 · Close above open
Yes
17:00 New York grid
Start (UTC)
Open
1.081345
High
1.081595
Low
1.081100
Close
1.081430
Quotes
1,273
End (UTC)
2024-07-09 21:00
H1 · Close above open
Yes
Both panels use the same H1 candles on 9 July. The highlighted hours belong to the selected H4. H1 shows the clock boundaries at one-hour resolution.08
Count differences at the decision time
Using only closed bars at those three decision times, the flag differed in 2 of 3 D1 comparisons and 1 of 3 H4 comparisons. The selected D1 in the UTC grid has an older closing boundary than the New York D1. The UTC grid's current daily bar remains in progress at 22:00 UTC.
How often the closed-candle flag differed between grids
Date and slot · D1
Comparisons
4
Different flags
0
Date and slot · H4
Comparisons
24
Different flags
7
Same decision time · D1
Comparisons
3
Different flags
2
Same decision time · H4
Comparisons
3
Different flags
1
Date and slot comparisons pair labeled bars. Decision-time comparisons use the last bar closed in each grid at the same UTC time.
Closed D1 and H4 bars at the first common decision
2024-07-09 22:00 UTC
D1 · Midnight UTC grid
Start (UTC)
2024-07-08 00:00
End (UTC)
2024-07-09 00:00
Minutes since the bar closed
1,320
Open
1.082465
Close
1.082580
Close above open · Yes
D1 · 17:00 New York grid
Start (UTC)
2024-07-08 21:00
End (UTC)
2024-07-09 21:00
Minutes since the bar closed
60
Open
1.082505
Close
1.081430
Close above open · No
H4 · Midnight UTC grid
Start (UTC)
2024-07-09 16:00
End (UTC)
2024-07-09 20:00
Minutes since the bar closed
120
Open
1.081565
Close
1.081340
Close above open · No
H4 · 17:00 New York grid
Start (UTC)
2024-07-09 17:00
End (UTC)
2024-07-09 21:00
Minutes since the bar closed
60
Open
1.081270
Close
1.081430
Close above open · Yes
The closing boundary and elapsed minutes explain which bars the decision could use.09
Check daylight saving time
On 8 January 2024, 17:00 in New York is 22:00 UTC. On 8 July 2024 it is 21:00 UTC. Use a time-zone database to make that conversion for each date. The one-hour seasonal change can move a bar boundary without any change to the local cutoff.
The same 17:00 New York cutoff in winter and summer
America/New_York
January example
Local cutoff
2024-01-08 17:00-05:00 EST
Equivalent in UTC
2024-01-08 22:00
July example
Local cutoff
2024-07-08 17:00-04:00 EDT
Equivalent in UTC
2024-07-08 21:00
Apply the offset for the date to obtain the UTC boundary.10
Separate chart display and aggregation
A platform can display UTC timestamps for candles aligned to a local day. OANDA's v20 API is an example with separate day alignment and time-zone parameters. Record the aggregation rule and inspect a sample of opening times before comparing results across platforms.
11
Handle short sessions and gaps
An empty interval has no OHLC from the source. Keep it missing and record the reason where you can verify it. Short Sunday bars, holidays and outages can change the shape and length of a sequence. Define your inclusion policy before evaluating a rule.
12
Keep price side and rounding consistent
The charts use quote midpoints throughout. Bid, Ask and midpoint can produce different OHLC from the same source. Record the selected side and use full input precision for comparisons. Round displayed values after aggregation.
13
Use a closed bar for a decision
Make the decision time explicit. A chart can show a current candle as soon as its first quote arrives. For a closed-bar rule, use the latest available nonempty interval that ends at or before the decision time. A trade model also needs a separately specified executable quote.
14
Reproduce the two builds
The JSON records the source archive, checksums, boundaries, OHLC and comparison results. Keep the original quote order, find the first and last quote in each half-open interval, and compute the maximum and minimum midpoint. Check the decision-time selection using the closing timestamps.
15
Interpret the sample within its scope
The test uses one EUR/USD archive and four July dates. It measures whether changing the aggregation grid changes a price flag. A full strategy comparison would also model execution and costs. The counts describe this sample.
16
Record the settings with the backtest
Save the price source, time zone, daily cutoff, H4 anchor, missing-bar rules and exact decision times. Compare both the resulting candles and the selected closed bars. That gives a second reader enough detail to reconstruct the test.
Frequently asked questions
Is D1 always a midnight UTC candle?
The day starts at the cutoff used to build the candles. Check the source and its alignment before assuming the date begins at midnight UTC.
Why do H4 candles change with the daily cutoff?
A day-aligned H4 series counts four-hour slots from the daily start. Shifting that start changes which quotes are grouped into each slot.
Does changing the chart's display time zone rebuild the candles?
A display change can relabel the same candles. Check whether the platform also changed the aggregation boundaries.
What happens to a tick exactly at the closing boundary?
In this test it goes into the next interval. The completed candle uses only quotes strictly before its closing boundary.
Why does a New York cutoff move in UTC?
The local cutoff stays at 17:00. The UTC offset changes with daylight saving time, so the UTC equivalent changes with the date.
Can I use the current D1 bar for a closed-bar signal?
Use the last completed bar for this rule. A rule intended to use a forming bar needs a separately specified decision time and data snapshot.