Skip to content
All library documents

Auditing Historical Price Data for Missing Bars and Gaps

Article MQL5 code base

Summary

The document describes a script for scanning market history to find missing bars, measure the lengths of holes, and report associated price gaps. It can read chart data or a history file, and exports results as a CSV table intended for inspection and machine analysis. Users can set minimum hole length and price-gap thresholds, classify larger holes as gaps, and choose whether the report includes a summary and detailed table.

This is a data-quality workflow, not a trading signal. The author notes that separate history files can be checked and combined to identify holes that might be filled from other sources. Results depend on the chosen thresholds and the correctness and compatibility of the input histories. A stated limitation is that spreadsheet locale settings may misinterpret fractional values when opening the output, and the document offers no validation results or guarantees that every missing interval can be reconstructed.

Key ideas

  • The script searches historical market data for missing bars and price gaps.
  • It can analyze chart data or read a specified history file.
  • Thresholds control which missing intervals count as holes or gaps.
  • CSV output supports sorting and filtering of the detected intervals.
  • Combining separate history sources may help identify intervals that can be restored.

Tags

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