Body
You run a backtest, the curve looks good, and then the uncomfortable question lands: is your data actually clean?
Most MT5 CSV exports are dirty — quietly. The terminal hands you a file that looks complete. It is not.

The five failure modes
Gaps. Connection drops, broker outages, re-export windows that stop mid-hour — missing bars that nobody notices until results drift between platforms.
Duplicates. Re-export the same range twice, merge two files, and the same bar appears twice. Inflated volume counts, broken "first bar of the day" conditions.
Zero-volume / zero-price bars. Exchange halts and feed glitches produce bars with no trades. Indicators computed on them are wrong, and the wrongness does not show up on visual inspection.
Timezone ambiguity. MT5 stores bars in broker-local session time. The same CSV read as UTC moves your strategy to a completely different time of day.
Expected vs actual. A known date range + timeframe should contain a known number of bars. If your file has 9,282 bars where 12,276 are expected, something vanished — and you would not know without doing the arithmetic.
What a clean-data check looks like
A useful report answers five numbers per file, in under a minute:
expected bars vs actual bars
missing bars, and how they cluster (one long gap = broker outage; many short = feed drops)
duplicate bars (exact count, not "there might be some")
zero-volume ratio
timezone/session note — the report states its assumption instead of hiding it
Example: 12,276 expected bars, 9,282 present → 2,994 missing, clustered in 2 gaps (2,970 + 16), gap-free ratio 75.6%. That is a file you should not backtest without first understanding why two days vanished.
Healthy baseline: gap-free ≥ 99%, zero duplicates, zero-volume < 1%. If your file fails that, the results above it are an estimate, not a measurement.
Try it — free, no signup
I built a small tool that runs this check in your browser: https://mt5-cleaner.streamlit.app
Drag a CSV in → it detects broker format, timeframe, and range → you get the quality report plus a cleaned CSV. Files never leave your browser and are gone when you close the tab. No account, no API key, free up to 200 MB.
The workflow I use before any backtest:
Export history from MT5 (CSV)
Run it through the checker — read the 5 numbers
If gap-free < 99%, re-export with a wider range or a different session before touching the strategy code
Sixty seconds of checking saves hours of debugging a strategy that was never wrong — the data was.
Source: https://github.com/RedSamerai/quantclean
Questions or weird report shapes — post them in the comments, the clustering heuristics are the fun part.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)