How to Clean XAUUSD CSV Data for MT5 Backtesting
Gold EA backtests are only as reliable as the historical data behind them. Missing candles, duplicates, bad OHLC rows and abnormal gaps can change indicator values and make the Strategy Tester report unreliable.
Clean Data Checklist
- Use one consistent timestamp timezone.
- Sort all rows chronologically.
- Remove duplicate timestamps.
- Check that high is above open/close and low is below open/close.
- Detect gaps larger than the expected timeframe.
- Verify abnormal jumps against session opens or news.
- Keep consistent decimal precision for XAUUSD broker symbols.
- Save a separate cleaned file instead of overwriting raw data.
Common MT5 Import Problems
MT5 imports can fail or distort results when the date format is wrong, separators are mixed, columns are missing, or broker symbol settings do not match the source data. Always test with a small sample first, then run Strategy Tester after import.
Why Missing Candles Matter
A missing M5 candle shifts moving averages, ATR, breakout ranges and retest logic. On XAUUSD, even a few missing bars around high-volatility periods can change whether an EA enters or avoids a trade.
Need Clean Data or Python Tools?
Use the free checker, download historical data, or request a custom cleaned dataset / Python validation script.
Check CSV Quality Historical Data