Skip to content
All library documents

Handling Empty Time Bars in OHLC Data

Article Quant Q&A · Author: TBohnen.jnr

Summary

The document explains how to represent a time-based price bar when no trades occur during its interval. It distinguishes the bar's open, ordinarily the first trade in that interval, from the previous bar's close; a new bar can open at a different price when trading resumes after a gap. For an interval with no trades, the answers recommend carrying forward the previous close, assigning it to open, high, low, and close.

The discussion also presents alternatives for building a time series: forward-fill missing bars, omit empty intervals, or consider sampling by volume rather than fixed time. These choices affect downstream analysis, since filling creates flat observations while dropping bars changes the sequence of sampled data. The answers state common conventions rather than a universal exchange rule, and they give no formal documentation or empirical comparison. Data users should select a treatment consistent with their market, data source, and analytical purpose.

Key ideas

  • An active bar's open is generally its first traded price, which may differ from the previous close.
  • A common convention for an empty time bar is to set all OHLC values to the previous close.
  • Forward-filling preserves the time grid but inserts a flat observation into the series.
  • Dropping empty intervals or sampling by volume are alternatives with different effects on analysis.

Tags

Full text
# What is the OHLC of a candle when there are no trades


# What is the OHLC of a candle when there are no trades












I hope I'm asking this in the right place. Couldn't find any definitive info anywhere.

When creating a candle / time series / bucket, is the open of the series the first price in that series and not the close of the previous series?

If so, what is the OHLC of a series if there are no trades in that series? Are they all set to the close of the previous series? Can anyone provide a link to some documentation on this?

## Answer by Sourav B. Roy (score 1, accepted)

https://quant.stackexchange.com/a/44941

I would agree that the open of a series is the first price in that series and not the close price of the previous series because very often in real world trading we come across stocks that open at a gap-up or a gap-down, a significant shift from the previous close price.

Now if there are no trades the line will be a flat line with the open, high, low and the close equal to the previous close price.

If i were using Tickwrite I would choose to Hold Last Value because losing data may prove to be costly is other forms of analysis. Good Luck.

## Answer by Jacques Joubert (score 0)

https://quant.stackexchange.com/a/44940

So this is a problem if you are sampling based on a fixed time interval. I would suggest you sample using a volume clock.

Back to your question: I think the most typical thing to do is to apply a forward fill to your data. So you use the previous close for the open, high, low, and close for the new bar.

Sometimes it is appropriate to drop empty rows. You could of course apply imputation to fill the missing values but this technique may have its own problems.

## Answer by Don Coder (score 0)

https://quant.stackexchange.com/a/45472

If there's no trade:

O = H = L = C = Previous close

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.