Testing and analysis
Missing Candles in Backtests: How to Check Data Gaps
Published ForeXpert team日本語で読む

If a candle seems to be missing from a backtest, record the timestamps on both sides, check the trading session and loading state, then investigate the underlying data. Do this before continuing to score trades. Inventing prices for an unclear interval can turn an uncertainty about data into an unsupported trading result.
This guide explains how to investigate missing candles in backtests and how to document periods you cannot verify. Our guides to time zones and daylight saving and backtest sample size cover clock alignment and the amount of testing separately. Here, the question is whether you can establish what price information was available during a particular interval.
What missing candles in backtests actually mean
A data gap means some of the historical price information needed for a test is unavailable. A jump between candle timestamps is a reason to investigate, but does not by itself prove a faulty feed. The instrument may have been outside its trading session, the provider may not have produced a bar, or the application may still be loading history.
Keep a price gap separate from a time gap. A difference between one candle's close and the next candle's open does not establish that a candle is missing. Conversely, a break in timestamps during a scheduled closure does not necessarily indicate a data failure.
| What you see | First thing to check | What it does not establish |
|---|---|---|
| A jump between timestamps | Instrument sessions and closures | A defective data feed |
| A price jump between consecutive bars | Previous close and next open | A missing time interval |
| History stops when scrolling back | Loading state and available dates | No trading occurred then |
| Different candles on another chart | Price basis and candle boundaries | One chart must be wrong |
MetaTrader 5's price-data documentation describes building minute bars from quotes and larger timeframes from those minute bars. That is a platform-specific description, checked in November 2026. It illustrates why seeing a larger candle is not the same as having verified all the finer information inside it.
Four steps to investigate an apparent gap
Use the same process whether the affected trade appears profitable or unprofitable. Choosing an explanation after seeing the outcome makes the investigation less useful.

1. Record the timestamps and context
Note the currency pair, timeframe, displayed time zone and the candle timestamps immediately before and after the suspected gap. Check whether the timestamp labels the start or end of a candle. Save a screenshot with the date, time and timeframe visible if the tool allows it.
“Something disappeared on Tuesday morning” is difficult to investigate. “On this date and time zone, the five-minute bar labelled 10:00 is followed by 10:20” identifies a specific interval. Record the observation first and leave its explanation open.
2. Check sessions and loading
Consult the provider's schedule for that instrument and date, including holidays or maintenance. For example, OANDA US's hours of operation list both a weekend closure and daily interruptions, as checked in November 2026. Do not apply one provider's schedule to every currency product or historical date.
Also separate a display problem from missing source history. Follow the tool's instructions, allow loading to finish, and check whether revisiting the interval changes the display. The official MQL5 data-access documentation describes situations where a series has not yet been formed or synchronized with the server. This is a platform-specific example of why “not currently visible” does not mean “absent from the provider.”
3. Compare equivalent data
Matching the pair name is not enough. Check whether the comparison uses Bid, Ask or midpoint prices, the same time basis, and the same candle boundaries. OANDA's candle definitions distinguish Bid, Ask and midpoint data explicitly, as checked in November 2026.
A candle on another feed is a clue, rather than proof of the original feed's prices. Pasting a few bars from a different provider into a test mixes assumptions. If history can be restored, prefer the same source and settings, keep the original evidence, and note when the replacement was obtained.
If you choose to test a different dataset instead, state that change and retest the relevant comparison period. Avoid treating a patched result as directly comparable with an earlier run whose price basis or aggregation differed.
4. Decide how to handle unresolved intervals
Do not manufacture a flat candle using the previous close, or draw a straight line between the surrounding prices and call it history. Neither method tells you the actual high, low or order of price movements during the gap.
Write a policy before scoring the affected trades. For example, hold the entire trade sequence that crosses an unresolved interval pending until the necessary data can be verified. Apply that policy regardless of the apparent profit or loss, and retain the pending count and dates.
This is not permission to remove inconvenient trades. If you cannot restore the information, report that the interval could not be tested. A partial result should be labelled as partial, with the unverified portion visible beside it.
A five-minute example: what remains unknown
The following is a fictional illustration, not a measured trading result. Suppose the instrument is expected to be trading, bar labels indicate opening times, and five-minute candles would normally be labelled 10:00, 10:05, 10:10, 10:15 and 10:20. Instead, the display goes straight from 10:00 to 10:20.
There are three expected labels to investigate: 10:05, 10:10 and 10:15. That count assumes the provider should create a bar in every five-minute interval under these conditions. Check its session and bar-formation rules before describing the observation as three bars lost to a fault.
Now suppose a position was already open during the 10:00 candle. The uncertainty extends beyond whether you missed a new entry. You may be unable to establish whether a stop or target was reached, whether a recent high or low changed, or whether an indicator used by the rules had the intended inputs.
A favorable price at 10:20 does not justify assuming the position survived until then. Nor should an unfavorable price be used to invent the missing path. Preserve the uncertainty until there is enough evidence to rerun the trade under the original rules.
| Record | Entry for this fictional example |
|---|---|
| Observation | The 10:00 five-minute bar is followed by 10:20 |
| Interval to investigate | Labels 10:05, 10:10 and 10:15, plus formation rules |
| Possible impact | Open positions, recent-bar conditions and indicator inputs |
| If unresolved | Keep affected trade sequences pending; document the limitation |
Changing to a larger timeframe does not recover the missing path. Even a known high and low do not reveal which came first. Our guide to stop loss and take profit in the same candle explains that separate order-sequencing problem.
What to record when practicing with ForeXpert
ForeXpert lets you advance historical charts one candle at a time and display multiple timeframes. The screenshot below shows the chart layout using demo data. It is not evidence of a missing-data incident.

If a timestamp jump concerns you, pause and write the pair, timeframe and surrounding dates in an external note before advancing. Use the other timeframe to understand context, rather than as proof that the smaller timeframe is complete or as a way to reconstruct prices.
Begin comparing performance only when you can describe the period used and its unresolved intervals. Removing pending trades from the denominator produces a statistic about the verified subset. It does not produce a verified result for the whole intended period. Keep the intended dates, verified trade count and pending count together.
Backtest results do not guarantee future performance. Actual trading can result in losses. Checking data helps explain the limits of a historical test; it does not establish that a strategy will be profitable or recommend any particular trade.
FAQ
Are missing weekend candles a data problem?
Not necessarily. Check the source's instrument schedule for that date. A planned closure should be distinguished from an unexplained absence of data during an expected session. Account for the time zone, daylight saving and holiday notices when making that comparison.
Can I fill gaps with the previous close?
Do not treat those invented prices as observed history for discretionary entries or order execution. Repeating the previous close does not establish the interval's high, low or whether an exit level was touched. Keep that uncertainty explicit instead of hiding it inside a normal-looking candle.
Can I use prices from a different chart?
Use them to investigate first. Check the source, price basis, timestamps and aggregation. If you change the dataset, document the change and rerun the relevant comparison range rather than silently inserting a few convenient bars.
Indicator-based tests also need sufficient earlier history. Our guide to backtest warm-up periods explains how to separate calculation preparation from the evaluation interval.
Summary
When a candle seems missing, record the surrounding timestamps, check sessions and loading, and compare equivalent data. Set a consistent policy for unresolved intervals and avoid creating prices to complete the chart.
For your next practice session, add one sentence to your written rules explaining how you will handle unverified history. Keep the verified scope beside the results so that later reviews show what you actually tested.


