When candles disappear: closed markets, missing data and silent feeds
Distinguish scheduled closures, missing data and bars without qualifying events, then measure how gaps change returns, indicators and observation windows.

The empty minute that starts the investigation
A chart jumps from one candle to the next and looks perfectly ordinary. The spreadsheet behind it tells a different story: several minute labels never appear. Someone proposes filling the spaces with the previous close. Someone else calls the file corrupt. Neither conclusion follows from the empty cells alone. Before repairing a price series, we need to decide whether those cells were supposed to contain observations, and what an observation would have meant.
Consider a hypothetical research feed for EUR/USD. Its declared session includes the twelve one-minute slots labelled 09:00 through 09:11 UTC. Our local file contains eight bars. The labels 09:03, 09:04, 09:05 and 09:09 are absent. We will use this small example throughout, with invented prices and explicit assumptions. It is an investigation exercise, not a record of a broker incident or evidence about any trading product.
The immediate fact is four absent bars on a twelve-slot scheduled grid. That is one third of the scheduled opportunities, or approximately 33.33%. It is not yet a measured packet-loss rate. Nor does it prove that trading stopped for four minutes. Those stronger statements require knowledge of the feed contract, the source events and the processing steps between the source and our file.
This article focuses on establishing that contract and diagnosing the empty intervals. A general missing-value technique cannot tell us whether a market was closed. Equally, a calendar cannot tell us whether a downloader discarded an otherwise valid candle. Define what should exist before deciding how to replace what does not. That ordering matters because the chosen explanation changes the denominator, the meaning of returns and the information a robot could actually have used.
Start with the observation contract
A bar is a summary of eligible events inside an interval. Its contract includes the instrument, the venue or broker feed, the price side, the interval boundary and the rule for minutes without eligible events. Two files both called EUR/USD M1 can disagree without either being damaged. One might summarize bid updates, another ask updates, and another a midpoint sampled on a clock. Comparing their row counts without those definitions confuses different measurements.
MetaTrader documentation describes minute bars built from symbol ticks and distinguishes bid-based OTC bars from last-price bars for exchange instruments. Its programming book also explains that a bar requires a tick in its interval, whose label is aligned to the interval boundary. These are platform-specific definitions, not a promise about every exported dataset. See the official price-data explanation and timeseries chapter.
Our hypothetical contract uses bid closes and start-labelled intervals: 09:02 covers events from 09:02:00 inclusive to 09:03:00 exclusive. A tick exactly at 09:03:00 belongs to the next interval. A bar labelled 09:02 is not a final observation available at 09:02:00. Unless the feed supplies a separate completion indicator, treating the label as the availability time would allow the strategy to see information from later in that minute.
The contract also distinguishes no quote event from no trade event. A quoted market may update bid and ask without any recorded transaction. A trade-based series could therefore omit a minute that a quote-based series includes. Conversely, a periodic quote snapshot may exist even when its price equals the previous snapshot. An unchanged price does not by itself mean an absent event.
Write down whether empty intervals are omitted, represented by nulls or synthesized by the vendor. Also record whether the source’s volume means ticks, traded units or something else. A zero in one field cannot explain an absent row in another. These definitions are necessary even when the planned strategy uses only closes: they determine what consecutive closes represent and whether their separation is fixed.
Build the grid without hiding the original file
The first useful transformation creates two views. One retains the inspected input file exactly as received, with its original identifiers and timestamps. Available upstream responses are preserved as separate evidence. The other joins those records to a scheduled interval grid. The join makes absent labels visible without inventing prices. It should also expose duplicate labels and records outside the schedule rather than silently dropping them. Both can reveal an incorrect timezone conversion or a misunderstood bar boundary.
For our example, the input labels are 09:00, 09:01, 09:02, 09:06, 09:07, 09:08, 09:10 and 09:11. The scheduled grid adds the four absent positions. There are twelve scheduled slots, eight observed bars and four scheduled slots without bars. The raw absence rate stays 4/12, even if subsequent investigation explains some absences. We can publish a separate rate for confirmed transport losses, but changing the label is better than quietly changing the denominator.
For an event-driven bar policy, the grid represents opportunities for bars, not a guarantee that twelve bars must be emitted. To calculate a strict expected-emission count, we would additionally need evidence of eligible source events in each slot. This distinction prevents a quiet interval from automatically becoming a data-quality failure. It also prevents the opposite mistake: declaring every unexplained absence legitimate simply because the feed sometimes omits empty intervals.
The official pandas reindex documentation describes conforming data to a new index and leaving missing values where labels lack observations. That operation can implement the join, but the researcher must supply the correct grid and interpretation. A library cannot infer the broker’s historical schedule from a sparse price file.
Keep the grid version, timezone rules and interval convention with the result. If a later calendar correction changes the scheduled count, retain the previous audit and explain the revision. Otherwise a file may seem to improve even though no observation has been recovered. A better explanation of an absence is not the same thing as an additional measured price.
A calendar belongs to a symbol and a feed
“Forex trades during the week” is too vague to generate minute labels. A usable calendar identifies the provider, relevant entity, instrument family, daily interruptions and exceptional sessions. As a concrete example of why specificity matters, OANDA’s US hours page lists a daily interruption for its forex products and different hours for TRY pairs. These are that provider’s published arrangements, not a universal Forex calendar. Consult the applicable official trading-hours page when defining a real feed.
For a separate hypothetical weekend illustration, suppose our declared schedule closes Friday at 22:00 UTC and resumes Sunday at 22:00 UTC. The forty-eight hours between those boundaries contain 2,880 clock minutes but zero scheduled trading slots. We exclude them from the missing-bar denominator before inspecting the data. If Friday’s last expected bar is present and Sunday’s first expected bar is absent, only the latter is a scheduled absence. The weekend itself has not become a multi-thousand-bar outage.
A holiday requires the same discipline. Suppose an announced early close removes the final sixty minutes of a session. Those minutes should be excluded using the calendar version available for the investigation, with the announcement preserved. A public holiday in one country does not automatically close every currency pair or every provider. If the applicable source remains open, sparse activity and missing observations remain separate hypotheses.
Do not infer closures from stretches of silence. A collector failure can produce an impressively clean overnight gap. If that gap is then used to infer the schedule, the audit has defined the failure out of existence. Historical calendars may need correction, but the evidence should be an applicable announcement or specification, not simply the absence being investigated.
Unexpected records during a declared closure also deserve attention. They might be indicative quotes, a different instrument session, late data or evidence that the calendar is wrong. Preserve them in an exception report. Removing them automatically would hide the very contradiction needed to correct the contract.
UTC solves ordering, not every clock problem
Store a normalized UTC instant alongside the original timestamp and its declared timezone. That makes comparisons possible without erasing how the source represented time. It is especially important when a provider defines sessions in a local timezone that changes offset during the year. A fixed numerical offset copied from one month is not a durable description of that schedule.
For an explicit arithmetic illustration, a local boundary at 17:00 converts to 22:00 UTC under an offset of UTC−5 and to 21:00 UTC under UTC−4. Those are two different assumptions, not a claim that a particular transition happens on an unspecified date. A timezone-aware calendar chooses the applicable offset for the actual date. The raw local label alone cannot do that when the label is ambiguous or the provider’s clock convention is unknown.
During a backward clock change, the same displayed local minute can occur twice. During a forward change, a run of displayed labels can be skipped. A deduplication rule based only on the printed local timestamp may delete valid observations in the first case. A completeness rule based on naive local arithmetic may invent missing observations in the second. Clock normalization must precede duplicate detection, while retaining enough original information to diagnose the normalization itself.
There is another clock distinction even on an ordinary day. The bar’s interval start, its interval end, its publication time and our reception time are different fields. A completed 09:02 bar arriving at 09:03:04 has four seconds of delivery delay under this example’s boundary convention. Comparing reception directly with the start label would incorrectly report sixty-four seconds of delivery delay.
Define a grace period before declaring a newly ended interval missing. If our hypothetical monitor waits five seconds, it should not flag that arrival as missing at the deadline. This operational threshold governs when we investigate; it does not alter the eventual price or erase the measured delay. The audit needs both concepts to avoid treating ordinary publication timing as an outage.
Classify causes with evidence, including uncertainty
Begin the diagnostic decision with the schedule: was the interval eligible for this source and symbol? If not, classify it as scheduled closure and record the calendar reference. If it was eligible, ask whether the raw source response contains a bar. A bar present upstream but absent in the analysis file points toward retrieval, parsing, filtering or storage. A bar absent upstream still leaves several possibilities, including a legitimate empty interval and a source-side loss.
Then inspect event evidence. If an available tick archive contains eligible ticks but the bar endpoint has no bar, the mismatch supports investigating aggregation or historical delivery. If the archive has no ticks, we must ask whether the archive is itself complete. “No events in the file” and “verified absence of events at the source” are not equivalent observations. Heartbeats may establish that a connection was alive while saying little about completeness for one instrument.
In our twelve-slot exercise, imagine later evidence confirms that 09:03 and 09:04 were lost by our collector, 09:05 had no qualifying quote event under the source policy, and 09:09 was removed by a local filter. The original four absences now have three different explanations. The confirmed collector-loss share is 2/12, approximately 16.67%, while the raw scheduled absence rate remains 4/12. These classifications are hypothetical findings, not statistics from a real feed.
Unknown is a useful classification. If the tick history and collector logs are both unavailable, forcing a cause produces false certainty. Record the competing explanations and the evidence that would discriminate between them. A secondary provider can show that a broad market was active, but cannot prove which bid updates should have appeared on the original provider’s feed.
This diagnosis should also separate confidence from consequence. One unexplained minute immediately before a decision can matter more than several explained empty intervals outside the feature window. Investigative priority may depend on use, but the cause should not depend on whether repairing the interval makes a backtest look better.
Cleaning can manufacture a gap
Suppose the source delivered the 09:09 bar, but a cleaning rule rejected it because its spread exceeded a threshold. The analytical series now has a hole even though collection succeeded. Calling it missing market data hides a deliberate censoring decision. The raw record should remain recoverable, with the rule identifier, measured field, threshold and decision time attached to the analytical exclusion.
Other filters create less obvious holes. A parser can reject a decimal representation; a symbol mapping can change halfway through a file; a rule can remove repeated closes under the mistaken belief that they are duplicates. Duplicate rows and repeated prices are different objects. Two consecutive valid bars can have identical closes while representing separate intervals and different intraminute activity.
For the running example, preserve a cause flag for 09:09 such as filtered locally, independently of the observation-present flag in the raw layer. Then a completeness report can answer two questions: how much source data was available, and how much was eligible for this analysis? Combining them into one “quality percentage” prevents a reviewer from understanding whether the problem belongs to acquisition or research design.
Filtering can also be selective in economically meaningful ways. Removing wide-spread periods may remove precisely the intervals when execution conditions deteriorate. That does not automatically make the filter inappropriate; it means the resulting study applies to the retained conditions. If the strategy would have held an existing position during the excluded minute, deleting the price row does not delete the position’s exposure.
Keep a separate action for the decision system. It might suspend new signals while a required feature is unavailable, retain an existing position-management process, or mark an evaluation interval ineligible. These are design choices requiring their own specification. The data-cleaning function should not silently decide that a position was closed or that a pending order disappeared. The companion discussion of the trading order lifecycle explains why those states need independent evidence.
Carrying a close forward changes the measurement
Give the observed closes at 09:00, 09:01 and 09:02 the hypothetical values 1.1000, 1.1001 and 1.1002. The next observed close, labelled 09:06, is 1.1008. The measured endpoint change from 09:02 to 09:06 is 0.0006, or six pips under a pip size of 0.0001. Its simple return is 1.1008 divided by 1.1002 minus one, approximately 0.0545355%. It spans four minutes between bar ends, rather than one observed minute.
Forward filling the absent 09:03, 09:04 and 09:05 closes inserts 1.1002 three times. The constructed return series now has three zeros followed by the entire endpoint return. Those zero returns are assumptions about unobserved intervals. They are not measurements of a motionless market. The final endpoints still agree, which can make the alteration easy to overlook when inspecting only a cumulative price chart.
The official pandas forward-fill documentation describes propagating the last valid observation into missing values. That is an operation on values, not evidence that a tradable quote remained available. If a dashboard uses it to hold the last displayed price, the display should carry the age of that observation and its synthetic status.
Consider a squared-change diagnostic in pips, deliberately avoiding a claim that it estimates realized volatility. The filled four-step sequence is zero, zero, zero and six, so the sum of squared changes is 36. A hypothetical unobserved path with four equal changes of 1.5 pips would produce a sum of nine. Another unseen path could have reversals and a much larger sum. Identical endpoints do not identify intragap variation.
Linear interpolation would choose the equal-step path, but it would use the later 09:06 close to construct earlier values. That may be a labelled visualization convention after the event; it cannot be treated as information available during the gap. Neither a flat bridge nor a smooth bridge recovers the missing trajectory. Keep any constructed series separate from observed prices and state which downstream calculations are allowed to consume it.
Indicators inherit the policy, not just the prices
At the completion of the 09:06 bar, a three-observation average uses closes 1.1001, 1.1002 and 1.1008. Its value is approximately 1.1003667. A three-slot average after forward filling uses the constructed 09:04 and 09:05 closes of 1.1002, plus 1.1008, giving 1.1004. The difference is approximately 0.3333 pip. Both calculations can be implemented correctly while answering different questions.
The discrepancy is not intrinsically large or small. Its relevance depends on the decision rule. Suppose a hypothetical diagnostic labels the average “above threshold” only when it exceeds 1.10038. The filled average passes and the observation-based average does not. This is not evidence of a profitable signal. It demonstrates that a data policy can determine a binary output even when the numerical difference looks insignificant on the chart.
An exponential average is also affected by how many updates are applied. Repeating an old price through absent slots can pull the internal state toward that stale price before the next observation arrives. Updating only on observed bars preserves a different memory. A time-decay formulation would need to specify elapsed-time decay explicitly. Merely naming an indicator does not define how it behaves during silence.
Highs, lows and volumes need separate treatment. Copying a close into every OHLC field creates a zero-range candle. It does not establish that no excursion occurred. Copying volume is worse if it invents activity; setting volume to zero is also a substantive statement unless zero is explicitly reserved as a synthetic marker. The safest representation depends on the consumer, but the origin flag must survive whichever representation is selected.
When investigating a changed indicator, compare the input timestamps and flags before adjusting its parameters. If the strategy changed after a data-library migration, the cause may be a different fill default, a different minimum-observation requirement or a changed treatment of the current incomplete bar. A parameter search would obscure that causal explanation. A small worked window like this one is often more informative than a full backtest comparison because each contributing observation remains visible.
Observation windows and duration windows answer different questions
Return to all eight observed labels and assign closes 1.1000, 1.1001, 1.1002, 1.1008, 1.1007, 1.1009, 1.1010 and 1.1006 in their listed order. At the completion of the 09:11 bar, the last five observations have labels 09:06, 09:07, 09:08, 09:10 and 09:11. Their labels span five minutes, while their individual intervals run from 09:06 to 09:12, covering six clock minutes with one absent interval.
A five-minute duration window ending at 09:12 covers the intervals starting at 09:07 through 09:11. It contains four observed bars because 09:09 is missing. The five-observation mean is 1.1008. The four available closes inside the duration window average 1.1008 as well. This deliberately chosen counterexample shows that equal indicator values do not prove equal information sets. The windows have different counts and coverage despite agreeing numerically.
If a rule requires five observed bars inside that duration window, its input is insufficient. Reaching farther back to 09:06 changes the horizon; inserting a synthetic 09:09 value changes the observations. Both may be explicit design options, but neither should happen through an undocumented convenience setting. A minimum-count test should name whether it counts scheduled slots, source bars or permitted synthetic values.
The distinction becomes more consequential across a weekend. A five-observation window can straddle a long closure while still containing five bars. A five-minute clock window after reopening may contain only a small amount of new data. A third definition, five minutes of scheduled trading time, is possible, but requires a calendar-aware clock. These are three different features rather than competing implementations of one obvious feature.
Specify both the horizon and the evidence required inside it. In an audit record, store observation count, scheduled-slot count and the oldest contributing event time. That makes a stale but technically complete observation window distinguishable from a genuinely recent one. It also gives a reviewer a concrete reason for a skipped decision without implying that the market itself was unavailable.
Reconstruct from ticks only when the evidence supports it
Suppose an independent archive from the same source provides four eligible bid ticks for the missing 09:03 interval. Their event times and prices are 09:03:05 at 1.1003, 09:03:20 at 1.1005, 09:03:40 at 1.1001 and 09:03:55 at 1.1004. Under our start-inclusive, end-exclusive convention, the reconstructed bar opens at 1.1003, reaches a high of 1.1005 and a low of 1.1001, and closes at 1.1004. It contains four ticks in this hypothetical archive.
That reconstruction is more informative than carrying 1.1002 forward, but only to the extent that the archive is complete and compatible. A missing early tick could change the open. A missing extreme could change the range. A missing late tick could change the close. An archive from a different provider might be useful for comparison while failing the requirement to reproduce the original source’s bar.
Store reconstruction provenance with the result: source identity, retrieval time, requested interval, event-time convention, price field, duplicate policy, ordering rule and reconstruction method version. Retain a checksum or stable reference to the input slice. The reconstructed bar should not overwrite the original evidence that the bar endpoint was absent in the first download. Those are two facts about different stages of the history.
Equal timestamps need an explicit tie-breaking rule if they occur. Arrival order may differ from source order, and sorting only by rounded seconds can erase relevant sequencing. Likewise, a vendor’s corrected tick should not be counted as a second independent event merely because it arrives later. The reconstruction contract needs to say how corrections are represented before claiming an exact match.
Rebuilding one minute does not prove that a whole missing block is recoverable. In our exercise, recovering 09:03 would leave 09:04 unresolved until its own evidence arrived, while the policy-empty 09:05 might properly remain absent. A recovery report should count reconstructed bars separately from original bars. The analytical dataset gains a usable observation, but its lineage continues to explain why that observation was unavailable in the original run.
Audit what was knowable at the decision time
Imagine the four-tick archive for 09:03 becomes available at 10:00. It can improve a historical reconstruction, but a decision taken at 09:07 could not have used that recovered bar. Keep an as-of view describing what the system knew at 09:07, and a corrected historical view describing the best data available after 10:00. Neither should silently replace the other.
This separation applies to causes as well as prices. At 09:07, the collector might know only that no bars arrived for three eligible slots. Later logs may establish that two were lost locally and one was legitimately empty. A cause discovered later cannot justify an earlier action retroactively. The earlier action must be evaluated using its actual uncertainty and the policy then in force.
An online monitor can still be useful without knowing the final explanation. It might track time since the last received event, the number of completed scheduled intervals without bars, the connection state and the age of the last complete feature window. Those measurements support a declared response to uncertainty. They should not be relabelled as verified exchange outages or absence of trading unless the evidence supports that interpretation.
Backfilled observations can create a subtle research leak when their availability is forgotten. A cleaned historical file may look complete exactly where the live process was blind. Testing decisions against that file estimates behaviour with improved information. That may answer a legitimate research question, but it does not reproduce the original information flow. Record which question the evaluation addresses.
Preserve the sequence of knowledge, not only the final sequence of prices. A useful audit entry includes the affected interval, detection time, provisional cause, evidence arrival time and final classification. This makes it possible to test whether a suspension rule was timely and whether recovery would have resumed only after the required observations were genuinely available. It also avoids blaming a decision process for failing to use evidence that did not yet exist in its accessible history.
Use adversarial small cases before trusting a large file
A compact test fixture should include an ordinary missing interval during a declared session, a scheduled closure, a legitimate policy-empty interval and a locally filtered record. The expected result is not that every row becomes complete. It is that each case retains its own meaning. Our twelve-slot example is useful because a reviewer can count the four absences directly and follow the later classification without trusting a summary percentage.
Add a boundary case with a tick exactly at the next minute, a delayed completed bar inside the grace period, and two valid observations sharing the same displayed local minute after a clock change. These cases expose interval and timezone assumptions that a large random sample may never challenge. The correct behaviour should be specified before running the test, including whether the record is retained, flagged or deferred.
Test the audit’s invariants as well as its output values. Joining the grid should not alter the original eight closes. Repeating the same import should not create sixteen bars. Rebuilding a recovered interval should preserve its provenance. Applying a research filter should not remove the raw record. A corrected calendar should create a new audit version rather than editing the previous result invisibly.
For a large dataset, summarize missingness by source, symbol, session segment and cause. A single global rate can conceal a narrow recurring failure at the session boundary. Also examine consecutive gap lengths: four isolated missing minutes and a four-minute block have the same count but affect different feature windows. Keep the count-based and duration-based summaries alongside each other.
Finally, sample the records behind every unusually good summary. A report showing no unexplained absences may be excellent, or it may be classifying all silence as closure. A report showing perfect coverage may be measuring a fully filled grid. The audit succeeds when another person can trace a classification back to evidence and reconstruct the denominator, not when its headline percentage looks reassuring.
Turn the diagnosis into a usable data policy
The completed policy should tell a reader what the source measures, when the source is expected to operate, which intervals are eligible for bars and how availability is recorded. It should also define what happens when the answer is uncertain. A practical decision rule can require recent observed inputs while leaving unknown historical cells unresolved. There is no requirement to manufacture a price merely because a calculation prefers rectangular data.
For our running example, retain the twelve-slot grid, the eight original bars and the four original absence flags. Attach the hypothetical findings of two collector losses, one policy-empty interval and one filtered record. If ticks later reconstruct 09:03, add that bar to the corrected view with its retrieval time and lineage. The original scheduled absence statistic remains an account of the original file; the corrected view receives its own coverage report.
The policy should name each permitted consumer. A display might show a stale last price with an age label. A feature calculation might reject synthetic values. A diagnostic chart might interpolate across a gap while marking the line as illustrative. Permission to transform data is specific to its use. Sharing one filled file among all three consumers would blur distinctions that the investigation worked to establish.
There is also a human handoff. When an unresolved gap blocks an analysis, the useful escalation contains the symbol, provider, interval boundaries, expected schedule, observed raw response and already excluded explanations. “The data is bad” is difficult to act on. “These two eligible intervals contain ticks in the archive but no bars in this response” points to a testable discrepancy without claiming more than the evidence shows.
The four empty minutes have therefore become a small, reviewable account of measurement rather than a cosmetic problem on a chart. The same method scales because it preserves the distinctions that aggregation usually hides: closed time, eligible silence, collection loss, filtering and later recovery. Once those are explicit, choosing whether to skip, reconstruct or display a stale value becomes a reasoned decision with visible consequences.
Primary sources
The linked OANDA trading schedule, MetaTrader price-data help, MQL5 timeseries chapter and pandas reindex and forward-fill references were consulted on 2026-11-29. They support the brief platform and library definitions cited above. All numerical scenarios, diagnostic policies and comparisons in this article are original hypothetical examples.
Use the TradeAndRoll demo to practise asking which observations support a robot’s inputs before interpreting its output.



