Skip to content
All library documents

HftBacktest Version 2 Migration: Return Codes and Data Formats

Article Stratmill research code

Summary

This migration guide explains changes users must account for when moving HftBacktest strategies and data from version 1 to version 2. The key control-flow change is that functions such as the event-advance operation and order submissions now return status codes: zero signals success, so callers must compare against zero rather than use the former boolean check.

The guide also describes a revised market-data representation, moving from structure-of-arrays to array-of-structures. A separate side column is replaced by event flags, which also identify whether exchange-side or local-side events are valid. Timestamp units have shifted from microseconds to nanoseconds, and live order latency data follows the new array layout. The document recommends rebuilding datasets from raw data where possible, with a conversion utility offered when raw data is unavailable. It is a compatibility reference, not a trading method or performance evaluation; incorrect status checks or timestamp assumptions can cause errors in strategy execution or data interpretation.

Key ideas

  • In version 2, zero indicates success for event-advance and order-submission calls.
  • Market data changed from a columnar layout to a structured record layout.
  • Event flags replace the side column and indicate exchange and local event validity.
  • Timestamp units changed from microseconds to nanoseconds, and latency data uses the new layout.
  • Reprocessing raw data is recommended when migrating datasets.

Tags

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