Skip to content
All library documents

Detecting Missing Market Data During Crypto Backtests

Article FMZ forum · Author: Han_nuo_ta

Summary

This Chinese-language forum post raises a backtesting problem: gaps in stored Bitcoin market data can leave an open position without later bars on which the strategy could close it. The example describes a long period of missing exchange candles and asks how such gaps should be handled to avoid misleading results. It does not provide a method for filling missing history or adjusting trade outcomes.

The accompanying snippet offers a simple live-data diagnostic. It records the time of the previous ticker request and logs a new ticker when the elapsed interval reaches a stated threshold, treating an unusually long delay as a possible gap. This can help identify interruptions in incoming data, but it does not establish whether the cause is missing historical records, a quiet market, or a feed outage. It also does not explain how to model fills or exits during unavailable periods, so the central backtest treatment question remains unanswered.

Key ideas

  • Missing candles can prevent a backtest from evaluating how an open position would later close.
  • The post’s example concerns Bitcoin data and a prolonged missing interval in stored exchange candles.
  • A ticker-time check logs data when the time since the previous request reaches the stated threshold.
  • The diagnostic can flag delayed observations, but does not prescribe how to handle gaps in backtest results.

Tags

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