Missing Data
Missing data is the absence of expected observations in a time series — gaps from holidays, trading halts, illiquidity or feed failures — and how you fill, drop or interpolate those gaps changes indicators and backtest results, often introducing subtle bias.
Quick answer: Missing data is the absence of expected observations in a time series — gaps from holidays, trading halts, illiquidity or feed failures — and how you fill, drop or interpolate those gaps changes indicators and backtest results, often introducing subtle bias.
In simple words
A market data series is supposed to have a value for every expected period, but reality leaves holes: markets close for holidays, trading halts on circuit breakers, thin instruments simply do not trade some minutes, and feeds occasionally fail. Missing data is these holes, and the tricky part is not spotting them but deciding what to do with them — because every choice quietly changes your numbers.
Purpose
Handling missing data matters because time-series indicators and portfolio logic assume regularly spaced observations, and filling the gaps carelessly can inject look-ahead bias, fake continuity or distorted returns without any visible sign.
Professional explanation
Distinguishing the kinds of gaps
Not all missing data is the same, and treating them alike is a mistake. An expected calendar gap — weekends, exchange holidays, the daily overnight break — is not missing data at all; it is simply a period with no session, and your calendar should encode it so you never try to fill it. A within-session gap on a liquid instrument (a minute with no bar when there should be one) usually indicates a feed problem. A within-session gap on a thin instrument (an illiquid option strike that did not trade) is genuine absence of trading. A halt — a circuit breaker or a stock suspension — is a real period during which no price existed. Each demands different handling, and the first step is always classification against a trading calendar.
Forward-fill and its hidden dangers
Forward-filling carries the last known value across a gap. It is convenient and often necessary to align instruments, but it is dangerous in specific ways. It creates artificial flat periods that suppress measured volatility, so an ATR or standard-deviation estimate over a forward-filled series understates risk. More seriously, forward-filling can smuggle in look-ahead bias if done carelessly across the boundary of when data actually arrived, or can make an illiquid instrument look continuously tradeable when in reality you could not have transacted at that carried price. A backtest that assumes fills at forward-filled prices for an instrument that was not trading is executing at prices that never existed.
Dropping rows and the survivorship trap
Dropping missing observations seems clean but has its own biases. Dropping bars where an instrument did not trade quietly removes exactly the illiquid, hard-to-trade periods — which are often the riskiest — flattering the strategy. In a cross-sectional or portfolio context, dropping any row where any instrument is missing (listwise deletion) can shrink and skew the sample toward the most liquid names and continuous periods, a cousin of survivorship bias. Dropping also breaks the regular time grid that many indicators assume, so a 20-period moving average computed after dropping rows spans a different, uneven amount of real time than intended.
Interpolation: inventing data between the gaps
Linear or spline interpolation fills a gap with a smooth path between the known endpoints. Its cardinal sin in trading is look-ahead bias: interpolating between a point before the gap and a point after it uses future information (the gap's end) to fill the present, which is impossible in live trading and inflates backtest performance. Interpolated prices are also unnaturally smooth, again understating volatility and, worse, presenting a tradeable-looking price at times when no market existed. Interpolation may be acceptable for some non-price reference series, but for prices used in a causal backtest it is almost always wrong.
How missing-data handling silently biases results
The through-line is that every gap-handling choice is an assumption that the backtest cannot see through. Forward-filling suppresses volatility and can fake tradeability; dropping removes the hardest periods and skews the sample; interpolation injects look-ahead. None of these throws an error — they produce a complete, tidy series that quietly misrepresents what a trader could actually have done. The discipline is to classify each gap by cause, choose a handling rule justified by that cause, apply the same rule in backtest and live, and never let a data library's silent default (many forward-fill by default) make the decision for you.
Gap-handling methods and their bias
| Method | What it does | Main risk |
|---|---|---|
| Forward-fill | Carry last value | Fakes tradeability, hides volatility |
| Drop | Remove the gap | Removes hard periods, breaks time grid |
| Interpolate | Smooth between ends | Look-ahead bias, false smoothness |
| Calendar-aware | Mark as no-session | None if calendar is correct |
Practical example
Illustrative example (Indian market)
Suppose you backtest a pairs strategy on two NSE stocks, one liquid and one thin. On several minutes the thin stock does not trade. If your data library forward-fills its price by default, the spread between the pair looks smooth and you generate mean-reversion signals — but at those minutes you could not actually have traded the thin leg at the carried price, so the backtest books fills that were impossible. If instead you drop those minutes, you remove exactly the illiquid moments when the spread was widest and the 'opportunity' looked best, flattering the strategy differently. The honest approach classifies the gaps as genuine illiquidity, excludes those minutes from tradeable signals (not just from the maths), and applies the identical rule live — at which point much of the apparent edge, which depended on untradeable prices, disappears.
NSE observes numerous trading holidays and can halt a stock on circuit limits or a scrip-specific suspension. A daily backtest must use the exchange holiday calendar so that a Diwali-week gap is treated as no-session, not as missing data to be filled — filling across a holiday would fabricate returns for days the market never traded.
Advantages
- Correctly classifying gaps prevents fabricated returns and impossible fills
- A proper trading calendar makes holiday and session gaps a non-issue rather than an error
- Explicit, cause-based handling keeps volatility and risk estimates honest
- Consistent live and backtest handling removes a whole class of train/serve mismatch
Limitations
- Every fill method biases the data; there is no neutral choice, only a justified one
- Distinguishing a feed failure from genuine illiquidity can be ambiguous
- Forward-fill and interpolation can make untradeable prices look tradeable
- Dropping rows breaks the regular time grid indicators assume and can skew the sample
- Data libraries often forward-fill by default, making a silent decision on your behalf
Common mistakes
- Interpolating price gaps in a backtest, which uses the gap's end (future data) to fill the present — look-ahead bias
- Forward-filling an illiquid instrument and then booking fills at prices that never traded
- Filling across exchange holidays instead of encoding them as no-session in a calendar
- Dropping untraded minutes, silently removing the riskiest, least liquid periods and flattering results
- Letting a data library's default fill behaviour decide, rather than choosing a rule per gap cause
- Handling gaps one way in research and another live, creating a hidden train/serve mismatch
Professional usage
Robust pipelines carry an authoritative trading calendar (holidays, half-days, session times) so calendar gaps are never mistaken for missing data, and classify every remaining gap by cause before choosing a rule. Prices are generally not interpolated for causal backtests; instead, periods without a genuine tradeable price are marked untradeable so the strategy cannot transact in them, and the same masking applies live. Forward-fill, where used for alignment, is bounded and flagged so it cannot silently fake long stretches of tradeability. The guiding rule is that a gap's handling must reflect why the data is missing, and must be identical in simulation and production.
Key takeaways
- Classify gaps by cause — calendar, feed failure, illiquidity, halt — before deciding how to handle them
- Forward-fill hides volatility and can fake tradeability; interpolation injects look-ahead bias
- Dropping untraded periods quietly removes the hardest, riskiest moments and flatters the strategy
- Encode exchange holidays in a calendar and apply identical gap rules in backtest and live
Frequently asked questions
What is missing data in a market time series?
Are weekends and holidays missing data?
What is forward-filling and when is it dangerous?
Why is interpolating price gaps a problem?
What is wrong with just dropping missing rows?
How do I tell a feed failure from genuine illiquidity?
What is the safest way to handle price gaps in a backtest?
Do trading halts count as missing data?
Why do data libraries forward-fill by default?
How does missing-data handling create train/serve mismatch?
Can forward-fill ever be acceptable?
How do gaps affect indicators like moving averages?
Should missing data be handled before or after other cleaning?
Why is a trading calendar essential for handling gaps?
Voice search & related questions
Natural-language questions people ask about Missing Data.
What is missing data in trading?
Is a market holiday missing data?
Why is forward-filling risky?
Why can't I just interpolate the gaps?
Is it okay to just delete the missing rows?
How should I handle gaps then?
Sources & references
Last reviewed 11 July 2026. Educational content only — not investment advice. Markets and rules change; verify current conventions with SEBI, NSE/BSE and your broker.