Skip to main content
Candle windowing is a boring detail that matters a lot. If the candle range drifts (even slightly), charts become misleading and score components (ROI, drawdown, time-above) can be wrong. OpenKol uses a strict windowing approach to keep everything aligned.

The windowing issue

Market data providers often return candles in ranges that are:
  • aligned to UTC boundaries, or
  • bucketed by day/week segments
If you request “around the call time” naively, you can get:
  • off-by-one candles
  • missing the exact call candle
  • drift across daily/weekly boundaries

Request strategy

OpenKol requests candles using a UTC-aligned anchor and a predictable range:
  • Round the anchor timestamp to UTC midnight
  • For weekly ranges, step in 7-day blocks
  • Request candles with explicit timezone handling (UTC)
This makes the upstream response predictable.

Trimming to the analysis window

After fetching candles:
  • Compare each candle timestamp to the call time
  • Keep only candles that fall inside the selected analysis window
  • Ensure the returned window matches the resolution (5m, 15m, 1h, 4h, 12h, 1d)
The scoring modules then operate on the trimmed window so “what the user sees” matches “what the system scored.”

Outcome

This approach:
  • keeps charts anchored to the call timestamp
  • prevents drift across daily/weekly ranges
  • reduces subtle off-by-one bugs that change ROI or drawdown