Skip to main contentThe windowing issue
Candle data must match the selected resolution and the call timestamp. If the anchor timestamp is wrong, the chart can drift and show the wrong window.
Request strategy
OpenKol requests candles using a UTC aligned timestamp and a predictable range:
- Round the anchor timestamp to UTC midnight.
- For weekly ranges, move in 7 day steps.
- Use the market data provider candle endpoint with an explicit timezone.
Trimming to the analysis window
After fetching candles:
- Compare candle timestamps to the call time.
- Keep only the candles that fall within the selected analysis window.
- Ensure the window matches the resolution (5m, 15m, 1h, 4h, 12h).
Outcome
This keeps chart windows aligned to the call and prevents off by one errors across daily and weekly ranges.