Skip to content
All library documents

Handling Out-of-Order Ticks When Building and Publishing Bars

Article vn.py community

Summary

This community post describes a data-engineering problem in market visualization: historical ticks can arrive after newer real-time ticks, causing a bar that appeared complete to change and making the latest candle visibly jump. The author proposes a minimal sequence with ticks arriving out of timestamp order, then suggests buffering by exchange time for a short window before publishing data. Bars already marked closed would remain immutable; late ticks would instead enter a revision path that explicitly marks corrections for the user interface.

The post also recommends keeping chart and strategy consumers from sharing mutable bar objects, so a display update cannot silently alter the data seen by a trading engine. It frames the key design choices as bounded reordering versus direct replacement and full recomputation, and asks about the performance cost of revision handling for fast instruments. No benchmark, implementation, or community consensus is provided, so the buffering interval and architecture are proposals to evaluate against feed behavior, latency needs, and downstream consistency requirements.

Key ideas

  • Out-of-order ticks can change bar highs and lows after a bar has already been shown as complete.
  • A bounded buffer sorted by exchange timestamp can absorb some arrival disorder before data is published.
  • Late ticks can be represented as explicit revisions while closed bars remain immutable.
  • Charting and strategy systems should avoid sharing mutable bar objects.
  • The post raises performance questions but provides no benchmarks or established best practice.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.