In this article
After this article, you can
- Prepare CSV with explicit timestamps and count missing positions in a declared window.
- Distinguish a gap, duplicate and OHLC conflict, then record which findings need investigation.
Terms at hand: Backtesting · bid and ask (bid-ask prices) · Expert Advisor (EA)
A missing candle does not tell you whether the provider failed or the market was closed. First compare the export with a declared time window and the provider’s candle construction rules. This guide includes a local CSV checker that finds empty positions on a fixed time grid, repeated timestamps, conflicting prices and invalid rows. It does not invent quotes. The report helps you decide what to resolve before running a historical strategy test.
What should you establish before counting missing candles?
Record the instrument, provider, price basis and timeframe. Bid, Ask and midpoint candles represent different series; the label EUR/USD alone is insufficient. Compare equivalent bar-opening times. An export labelled by candle closing times will appear shifted against an opening-time export even when both contain valid prices.
The checker accepts the header timestamp,open,high,low,close. Each subsequent row has exactly five comma-separated fields. Write prices with a decimal point and without thousands separators. Quoted fields, additional columns and semicolon-separated exports require conversion first. The checker explicitly rejects these unsupported formats rather than guessing what an export means.
Use a full timestamp such as 2026-10-12T08:00:00Z or 2026-10-12T10:00:00+02:00. These represent the same instant. Seconds are required; up to three fractional-second digits are supported. A time without an offset does not identify the server’s time zone. Adding Z to a local server time changes its meaning rather than converting it to UTC. Check OANDA’s alignment parameters for its candle conventions.
Declare the first and last expected bar openings separately. Both boundaries are included: 08:00 through 08:11 at a one-minute interval means twelve expected timestamps. The grid is anchored at the first boundary and the last must fall exactly on it. This model covers equal elapsed-time intervals. A calendar month, or a local day whose duration changes with daylight saving, cannot be represented by a fixed 1,440-minute assumption.
How do you run the checker and reproduce the example?
Load the prepared CSV, enter an integer interval from 1 to 1,440 minutes and provide both boundaries. Analysis runs in your browser without sending the file’s contents or saving them in persistent storage. The file limit is 2 MiB, with limits of 100,000 rows and 100,000 expected grid positions. Split a longer period into documented, non-overlapping windows.
Prices allow up to 15 significant digits and 48 characters per field. More precise records are invalid, so rounding cannot conceal a conflict.
Check CSV time-grid coverage
The file is analysed locally; the tool neither sends it nor saves it persistently. Format: timestamp,open,high,low,close. Maximum 2 MiB. Timestamps require Z or an explicit offset.
Fictional export: twelve rows do not establish completeness
The practice files are synthetic; they are not broker quotes or account data. Select M1, from 08:00 through 08:11 UTC. The clean file contains twelve different timestamps with no empty positions. The diagnostic file has twelve rows but only eight valid grid positions.
| Finding | Meaning in this example |
|---|---|
| 4 empty positions | No valid candle at 08:03, 08:04, 08:10 or 08:11. |
| 2 repeated rows | The 08:02 and 08:06 timestamps occur again. |
| 1 conflicting-price group | Two valid 08:06 candles have different OHLC values. |
| 1 invalid row | The 08:04 high is below its opening price. |
| 1 off-grid row and 1 time reversal | 08:07:30 is not on M1; 08:08 appears after 08:09. |
The longest gaps each contain two expected bar openings. A tie returns the first: 08:03–08:04. This is not a measured outage duration. Conditions in that interval still need to be explained using information outside the file.
Fictional M1 coverage: eight positions out of twelve
Which findings need investigation rather than automatic repair?
Coverage counts distinct valid timestamps, not rows. An identical duplicate adds no coverage. Conflicting but valid OHLC records at the same timestamp occupy one grid position and are also flagged as a conflict. Consequently, zero missing positions does not establish usable data. Resolve the price against its source while keeping both versions for comparison; the checker does not choose the higher, newer or more convenient value.
An invalid record contributes no coverage. The checker requires finite prices and checks that the high is no lower than the open, close or low, while the low is no higher than the other prices. Outside-window and off-grid records do not improve the result. All findings are counted, but only twenty examples per group are displayed so a damaged export cannot overwhelm the page.
Compare a weekend gap with the actual product’s session calendar. Investigate a gap inside a declared session using the download log and original source. OANDA’s candlestick documentation defines complete in terms of the candle period having ended; it does not certify a whole export as complete.
Do not fill an empty interval with the last price merely to produce a continuous chart. This creates synthetic candles and can alter indicators and stop execution. Sorting rows does not resolve conflicting OHLC. Preserve the original export and a separate correction record, including the reason and source for each change.
Do complete OHLC bars prove MT5 used recorded ticks?
No. Bars do not describe the entire price sequence. MetaQuotes documents generated ticks when a minute bar exists but its ticks are missing. Complete M1 CSV coverage therefore cannot prove the test used only recorded observations. Inspect the tester log, available tick period and selected model.
Also compare requested and actual test dates. History preparation documentation explains that insufficient history can shift the test start. When exporting with CopyRates, compare requested and returned counts because downloading may still be in progress. Our MT4 and MT5 testing guide addresses platform settings, while strategy testing methodology connects those checks to validation.
What to do tomorrow with the data report?
- Save the original export, checker settings and report. Add the instrument, price basis, time zone and session source. This gives another person enough information to repeat the same check instead of comparing unexplained charts with different underlying assumptions.
- Investigate the longest gap and every conflicting-price group. Compare source records and the download log. Document a confirmed closed session, or obtain a corrected export when data are missing. Run the same window again and retain the previous report.
- Run a short visual strategy test on the accepted interval. Inspect signals around flagged gaps, spread costs and execution order. Continue with data and signal checks in Python if building a separate engine. The report does not predict future returns.
Check your understanding
One short exercise
About 2 min · you can try again
An export has 12 rows but 8 distinct valid timestamps on a 12-position grid. How many positions are empty?
- 4
- 0, because the row count matches
- 8
Check the answer and explanation
4
12 expected positions − 8 occupied positions = 4 empty. Duplicates and off-grid rows add no coverage.
Frequently asked
Does an empty minute automatically mean a provider error?
No. The checker finds no valid record at a declared grid position, but it does not know the product’s session or the provider’s publication rules. Compare the gap with the schedule, time zone and download log first. Those details help distinguish a closed market, an export problem and missing observations. Do not insert a price before investigating the cause. Retain the document used to establish the session schedule.
Why can there be zero gaps and an OHLC conflict?
Coverage asks whether a grid position has at least one valid record. Two candles with different prices may both pass OHLC checks and share the same timestamp. That position is occupied but remains ambiguous. The checker reports the conflict separately and does not select a price version. Reconcile it against the original source before accepting the dataset. Sorting cannot resolve it because both records refer to one instant.
Can the checker read any export without conversion?
No. The supported format has exactly five columns headed timestamp,open,high,low,close, decimal-point prices and full timestamps with UTC offsets. Quotes, semicolons, extra columns and unzoned server times require preparation. Preserve the original and document the conversion. Also establish whether timestamp identifies the bar opening before interpreting any result, because a closing-time export represents a different grid. Converting the delimiter alone does not resolve an ambiguous timestamp.
Is a complete grid enough to accept a backtest?
No. Grid coverage is one data check, not a strategy test. Complete OHLC does not reconstruct every tick, historical spreads, fees or order execution. Review price conflicts, the source and the execution model, then check program behaviour and test chronology. Historical results remain simulations. This checker establishes neither future profitability nor a provider’s overall reliability. Preserve the previous result when changing data or execution assumptions.
Sources & bibliography
-
MetaQuotes Real and Generated Ticks · Real Ticks section: generated replacements when a minute bar exists without tick data; bars versus price sequences. www.metatrader5.com ↗
-
MetaQuotes How the Tester Downloads Historical Data · Data synchronization and possible actual test-start adjustment when history is insufficient. www.metatrader5.com ↗
-
MetaQuotes CopyRates — MQL5 Reference · Return Value and Note: returned element count and history downloading that continues after a partial result. www.mql5.com ↗
-
OANDA Instrument Definitions — Candlestick · complete refers to the candle period having ended; bid, ask and midpoint price bases. No attribution of a no-ticks/no-candle rule. developer.oanda.com ↗
-
OANDA Pricing Endpoints — Candlestick alignment · dailyAlignment and alignmentTimezone illustrate why calendar alignment and a fixed UTC grid need distinct assumptions. developer.oanda.com ↗
