Skip to content
All library documents

Preparing Full-Depth Crypto Data and Snapshots for High-Frequency Backtests

Notebook Stratmill research code

Summary

This guide explains how to prepare tick-by-tick trades and full order-book updates for HftBacktest, noting that this level of historical data is not commonly available for free in the way daily bars are. For Binance Futures, it describes collecting raw feed data, converting it to the backtester’s normalized format, and optionally saving the result. The conversion process reorders rows in an attempt to correct timestamps; the local receive timestamp is identified as nanosecond-based.

The guide also covers building end-of-day depth snapshots so continuous-market data has an initial book for the next session. It gives an alternative workflow using Tardis.dev trade and incremental depth files, recommending that trades be supplied before depth updates because same-time input ordering affects event priority and simulated fills. Caveats include potential exchange timestamp problems, the need for snapshot continuity, and memory-buffer adjustments for large files. These are data preparation procedures; the excerpt presents no strategy results or evidence that any particular simulated fill model matches live execution.

Key ideas

  • High-frequency backtests need tick-by-tick trades and full order-book updates rather than daily bars.
  • Binance Futures raw feed data can be converted into a normalized format, with row reordering intended to address timestamp order.
  • End-of-day depth snapshots can initialize the following day’s simulated order book.
  • When converting Tardis data, input order matters for events sharing a timestamp, and trades are recommended before depth updates.
  • Exchange timestamps and snapshot continuity can limit the accuracy of prepared backtest data.

Tags

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