Skip to content
All library documents

Synchronizing Leg Timestamps in Live Spread Calculations

Article vn.py community

Summary

The post describes a timing issue in a live spread engine for a two-leg arbitrage. At startup, each leg has zero bid and ask volume, so the engine waits until both have received data. Afterward, however, it may calculate a spread as soon as either leg updates, combining the newer tick from that leg with the previous tick from the other. When the second leg updates, it calculates another spread using both current ticks. This can create multiple values with mismatched event times.

The author asks whether these interim calculations are reasonable or consequential and considers requiring identical timestamps. That strict rule could suppress calculations when a less active contract sends no new tick for several seconds, even if its displayed market has not changed. The post raises a real data-alignment tradeoff but provides no measured error, proposed resolution, or performance evidence. It leaves open how to distinguish a valid unchanged quote from stale data and how to handle different tick frequencies in a production spread calculation.

Key ideas

  • A spread engine can combine a newly updated leg with a prior tick from another leg.
  • This may produce interim spread values before both legs have updated for the current moment.
  • Requiring equal timestamps can prevent mismatched inputs but may block calculations for less active contracts.
  • The post identifies a synchronization problem without quantifying its trading impact or validating a solution.

Tags

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