Futures Tick Database: Can Your Backtest See a Trade Correction Too Soon?

TickDB Research ·

A futures tick database is suitable for live-like backtests only if it can replay what your strategy could actually see at each decision, including the original records before a later correction. Use the latest corrected tape for retrospective analysis. Even if both views describe the same contracts and event timestamps, they are not interchangeable.

Use two clocks, not a single trade timestamp

Event time says when the upstream event occurred. Availability time says when your replayed component first could have used the message. At your collector, that might be receipt time; if the strategy can read only committed batches, its clock should reflect when the batch became visible. Exchange publication, local receipt and strategy availability are different boundaries. A historical endpoint that has only an event timestamp cannot recreate your historical access latency.

In the example, trade A originally printed at 400 ticks and became available at 100 ms. A later record changes its price to 398, but only becomes visible at 250 ms. Trade B is cancelled at 300 ms. At a decision time of 200 ms the strategy sees 400 and 401, not the final answer of 398. The timeline is schematic, with synthetic data and a non-linear time axis.

Replay timeline: at 200 ms trades A and B are visible; the later correction and cancellation are not.

Run a cutoff test before comparing query speed

This fixture keeps the messages in availability order, uses known trade IDs, and treats None as a cancellation. Running it locally requires only Python; it performs no network calls. The four assertions cover an empty prefix, the original decision, the correction, and the cancellation.

# Synthetic: available_ms, trade_id, event_ms, price_in_ticks
log = [(100, "A", 90, 400), (120, "B", 110, 401),
       (250, "A", 90, 398), (300, "B", 110, None)]

def visible_prices(cutoff):
    state = {}
    for available, trade, event, price in log:
        if available <= cutoff:
            state[trade] = price
    return [p for p in state.values() if p is not None]

for cutoff, expected in [(99, []), (200, [400, 401]),
                         (250, [398, 401]), (300, [398])]:
    observed = visible_prices(cutoff)
    assert observed == expected, (cutoff, observed)
    print(cutoff, observed)

What to require from the data source and database

  • Source: Ask whether cancellations and corrections arrive as separate events and how their identifiers and ordering are scoped. CME's MDP 3.0 certification materials include a trade-cancel case; that does not establish what any normalized downstream API preserves. TickDB documents trade streaming for China and Hong Kong futures. Confirm field semantics and revision retention for the feed you intend to capture rather than assuming a correction archive exists.
  • Storage: Keep an append-only delivery log and a separately derived latest view. Index by instrument and strategy-visible order, with a durable sequence to break ties. If availability clocks are not comparable, use the strategy's own input ordering instead of merging collector clocks as if synchronized.
  • Acceptance: Run the same cutoff test after compaction and after rebuilding the latest table. The 200 ms result must stay the same. A cancelled trade disappears from the projection after the cancellation becomes visible, not from the raw log. Missing visibility evidence means the replay is not verified, even if its final totals match.

This sample assumes ordered deliveries and unambiguous identities. Production adapters also need documented handling of duplicate, out-of-order or unresolved messages. If a vendor gives you only final history, use it for analysis that tolerates revised data; do not pass it off as a live-like backtest.

Category coverage

Futures
49,787
12/7/2026

Explore related data tools

Related articles

Choosing a Futures Tick Database: Test Event Fidelity Before Query Speed

Which database is best for futures tick data? Choose one that preserves the events your application needs before comparing query speed. Two trades can share a timestamp, continuous symbols can change their underlying contracts, and database deduplication rules differ. A small synthetic replay test can expose these mistakes before a fast query turns them into plausible but incorrect results.

TickDB Research ·

Build a Python Stock Quote Snapshot with Explicit Missing-Data States

A Python stock API response needs more than a successful HTTP request before it can become a useful quote snapshot. Check the response envelope, match returned symbols to the requested list, and preserve missing fields instead of replacing them with zero. The documented TickDB ticker schema supplies the request and required fields; a defensive parser separates absent, null, blank, invalid, and numeric values without claiming that a snapshot proves freshness.

TickDB Research ·