Crypto OHLCV Timestamps: Candle Open Time vs Close Time
A candle's timestamp can mark when it opened or when it closed. Mixing the two shifts every signal by one bar.
Short answer
Most crypto APIs label candles by open time: Binance's kline arrays put open time at index 0 and close time at index 6, and bars are identified by open time. If you treat an open-time label as a close time, every calculation shifts one bar earlier, creating lookahead (you use a bar's data before it finished). Normalise all sources to one convention, store both open and close times if available, and use UTC milliseconds or ISO strings consistently.
Two conventions
| Label | A 1h candle labelled 10:00 covers |
|---|---|
| Open time | 10:00:00 – 10:59:59 |
| Close time | 09:00:00 – 09:59:59 |
Put Crypto OHLCV Timestamps next to price, flow and positioning in one workspace.
Open a ChartsPod workspaceThe lookahead risk
If your code believes the 10:00 bar closed at 10:00, it may act on that bar's close at 10:00 in a backtest, but in reality that close was known only at 11:00. Every signal gets one bar of foresight.
Rules
Related: How to Backtest Crypto Strategies Without Lookahead Bias, Why Two Crypto Chart Providers Disagree on the Same Candle.
A quick alignment test
Pick a known event with a sharp move at a precise time, such as a large liquidation candle. Load the same market from two sources and check that the move lands in the same labelled bar after your normalisation. If it lands one bar apart, one source uses a different convention or time zone. Run this test whenever you add a data source.
Conclusion
Normalise candle timestamps to one convention in UTC and make sure signals use only bars whose close time has passed.
Review Crypto OHLCV Timestamps with bar replay before using it live.
Open ChartsPod replayQuestions readers ask
Are Binance kline timestamps open or close?
Bars are identified by open time; close time is also included.
Why does it matter?
Misalignment shifts signals and creates lookahead.
Which convention should I use?
Either, consistently; open time is common.
Sources and methodology
API behaviour comes from DEX Screener's API reference, CoinGecko's onchain API documentation and Binance's USD-M market data documentation as read on 17 October 2026. Code-level details are described conceptually; check current endpoint versions before building. Examples use illustrative values.
- Binance: USD-M market data (long/short ratios, OI statistics, klines) — ratio definitions, 30-day retention, kline open/close time.
- CoinGecko API: Onchain OHLCV WebSocket — pool candles, base/quote selection, nullable fields.
- TradingView Pine Script: Repainting — live vs historical calculation.
This article explains research tools and workflows. It is not financial advice, does not recommend buying or selling any asset and does not predict prices. Crypto derivatives carry a risk of rapid and total loss of margin.
CHARTSPOD EDITORIAL EDITION · RESEARCH AND EDUCATION ONLY · NOT FINANCIAL ADVICE.