Loading…

History Quality Checker

Every strategy tester result and every live indicator reading is only as good as the history bar data behind it, and MetaTrader gives no built-in warning when that data has holes. A broker feed can drop hours of bars during a connection issue, occasionally deliver the same timestamp twice, or (less commonly today, but still seen on thinner symbols) report a real candle with zero recorded tick volume. Any of these silently distorts a moving average, a volume-based indicator, or a backtest that assumes continuous, well-ordered history. This tool scans the currently loaded bars and reports three specific defects: gaps wider than InpGapMultiple times the chart's own period, timestamps that do not strictly increase from one bar to the next, and bars with zero tick volume. Each gets a count and the most recent example's timestamp on an on-chart panel, colour-coded so a clean history is immediately visually distinct from one with problems. The naive gap check would flag every weekend, since forex markets close for roughly 48 hours every week - that is normal, not broken data. This indicator checks whether a Saturday falls inside the gap and excludes it if so, so the report is not flooded with routine market closures and genuine data holes stand out. Notes and limitations - The weekend-gap exclusion checks only for a Saturday inside the gap span; it does not model specific market holidays, so an unusually long holiday closure on some instruments (year-end, certain exchange holidays) can still be flagged as a gap even though it is not broken data - check the date before assuming a fault. - Tick volume, not real traded volume, is what MT4 exposes; a zero reading means the feed recorded no ticks in that bar, which is a meaningful data-quality signal but is a different measurement from exchange volume on instruments where that distinction matters. - This tool inspects bars already loaded into the terminal; it does not download additional history itself. If InpScanBars exceeds the bars actually available, the scan simply covers what is present. - Reporting is a diagnostic aid, not a repair tool - fixing bad history still requires the terminal's own History Center re-download.

Indicator · MT5 · v1.0 · Free

About History Quality Checker

History Quality Checker is an indicator for MetaTrader 5. It has 8 settings, such as Scan bars, Gap multiple and Flag zero volume. MQL source code included.

Files in the download: HistoryQualityChecker.ex5, HistoryQualityChecker.mq5, HistoryQualityChecker.txt.

Settings

SettingDefaultWhat it does
Scan bars5000Closed bars scanned, back from the most recent
Gap multiple3.0A gap wider than this many periods is flagged (weekends excluded, see notes)
Flag zero volumetrueFlag bars whose tick volume is zero
CornerCORNER_LEFT_UPPERPanel corner
X distance10Panel horizontal offset, pixels
Y distance20Panel vertical offset, pixels
Font size9Row font size
Row height16Row height, pixels

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Volume · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria