Which batch gets the 13:00 HYPEUSDT candle?
The HYPEUSDT five-minute candle with open_time 1794632400000 opened at 13:00 Hong Kong time on November 14, 2026, so it belongs in [13:00, 13:30). The chart shows the 12 opening times extracted from the Binance archive. Six belong to [12:30, 13:00), from 12:30 through 12:55, and six belong to [13:00, 13:30), from 13:00 through 13:25. Binance Data Vision HYPEUSDT five-minute archive
Assign each candle by its opening timestamp t using start <= t < end. In a regression test, count the 13:00 timestamp in each batch. A combined count of one would also accept (1, 0), which puts the candle in the earlier batch.
Check the boundary in Python
The example uses the 12 opening times from the chart and sets the timestamps and batch bounds in Asia/Hong_Kong. Each assertion checks a pair of counts in the order (first batch, next batch).
from datetime import datetime from zoneinfo import ZoneInfo hong_kong = ZoneInfo('Asia/Hong_Kong') def at(hhmm): return datetime.fromisoformat(f'2026-11-14T{hhmm}').replace(tzinfo=hong_kong) opens = [at(hhmm) for hhmm in ( '12:30', '12:35', '12:40', '12:45', '12:50', '12:55', '13:00', '13:05', '13:10', '13:15', '13:20', '13:25', )] start, boundary, end = at('12:30'), at('13:00'), at('13:30') def boundary_counts(rows, *, include_first_end=False): if include_first_end: first = [t for t in rows if start <= t <= boundary] else: first = [t for t in rows if start <= t < boundary] second = [t for t in rows if boundary <= t < end] return first.count(boundary), second.count(boundary) assert boundary_counts(opens) == (0, 1) assert boundary_counts(opens, include_first_end=True) == (1, 1) assert boundary_counts([t for t in opens if t != boundary]) == (0, 0) assert boundary_counts(opens + [boundary]) == (0, 2) All four assertions passed in Python 3.12.16. Making the first batch’s end inclusive gives (1, 1) because the same row appears in both batches. Removing the 13:00 row gives (0, 0). Adding a second copy gives (0, 2) because both copies belong to the later batch.
For a loader regression test, pass the normalized opening timestamps through the batching function and compare each returned sequence with its expected sequence. If the loader writes to storage, replay the same batch and check that the stored timestamps still match the expected sequence in order, with each timestamp appearing once.
AI assistance was used to draft and revise this article.
原文:https://www.a8q9.cn/en/article/which-batch-gets-the-13-00-hypeusdt-candle-4d5869.html