OHLC Data
OHLC data summarises a time interval into four prices — the open, the high, the low and the close — giving a compact bar that records where price started, its extremes and where it ended, but not the path in between.
Quick answer: OHLC data summarises a time interval into four prices — the open, the high, the low and the close — giving a compact bar that records where price started, its extremes and where it ended, but not the path in between.
In simple words
An OHLC bar is a snapshot of one slice of time — say one day or one minute. It tells you the first price traded (open), the highest and lowest prices reached (high and low) and the last price (close). Think of it like a daily weather summary: you learn the day's high and low temperature and where it started and ended, but not the exact minute-by-minute swings.
Purpose
OHLC bars compress a stream of thousands of trades into four numbers per interval so that strategies, charts and indicators can work with a manageable, uniform time series.
Visual explanation
OHLC Data
How raw trades are aggregated into OHLC bars that feed indicators and signals.
Professional explanation
What the four values actually mean
Each bar is defined by an interval boundary. The open is the price of the first trade at or after the interval start; the close is the price of the last trade at or before the interval end. The high and low are the maximum and minimum traded prices within the interval. On NSE the daily open reflects the pre-open call-auction discovery price at 9:15, not merely the first continuous trade, which is a subtlety many retail data feeds gloss over. Volume — total quantity traded in the interval — is almost always shipped alongside OHLC, making it OHLCV in practice.
What a bar hides: the intrabar path
The single most important limitation of OHLC is that it discards the order in which the high and low occurred. A bar with open 100, high 108, low 96 and close 102 could have gone up first then down, or down first then up — the data cannot tell you. This ambiguity is fatal for any backtest that assumes both a stop-loss and a target could be hit inside the same bar: you cannot know which triggered first. Conservative backtesting assumes the worst-case ordering, or drops to a finer interval to resolve it.
Bar intervals and how they are built
Common intervals are 1-minute, 5-minute, 15-minute, daily, weekly and monthly. A higher-timeframe bar can be reconstructed from lower-timeframe bars: a daily open equals the first minute's open, the daily high is the max of the minute highs, the daily low the min of the minute lows, and the daily close the last minute's close. This roll-up must respect session boundaries — a daily NSE bar spans only 9:15 to 15:30, so aggregating across the overnight gap is meaningless. Getting the aggregation wrong is a common silent source of corrupt higher-timeframe data.
How bad OHLC silently corrupts a backtest
OHLC errors rarely announce themselves. A single bad high — a fat-fingered print or a feed glitch showing Nifty at 2,50,000 — will not crash your code; it will quietly inflate an ATR reading, trigger a phantom breakout, or set an impossible stop, and your equity curve will look plausibly wrong. Because backtests aggregate thousands of bars, one poisoned bar per hundred can shift a Sharpe ratio meaningfully without any single obvious outlier. This is why OHLC data must be validated (high greater than or equal to open, close and low; low less than or equal to all) before it is ever trusted.
Close price is special
The close is the most-used single value in systematic trading: most indicators (moving averages, RSI, MACD) are computed on closes, most signals are evaluated on the bar close, and most end-of-day strategies act on it. On NSE the official daily close is not the last traded price but a volume-weighted average of the last 30 minutes (a closing-price computation), which can differ from the last tick. A backtest that fills at the last tick while the exchange marks-to-market at the weighted close introduces a small but systematic discrepancy in P&L and margin.
OHLC bars vs raw ticks
| Aspect | OHLC bar | Raw ticks |
|---|---|---|
| Size | 4 numbers per interval | Every trade/quote |
| Intrabar path | Lost | Fully preserved |
| Storage cost | Low | Very high |
| Fill modelling | Approximate | Precise |
| Typical use | Most bar strategies | Microstructure, HFT |
Practical example
Illustrative example (Indian market)
Suppose a Nifty 15-minute bar reads open 24,980, high 25,060, low 24,940, close 25,010, volume 1.2 lakh contracts. Your breakout system enters long when price exceeds the prior bar's high of 25,050 and places a stop at the prior bar's low of 24,930. During this bar both 25,060 (above entry) and 24,940 (near the stop) printed — but OHLC cannot tell you whether price spiked to 25,060 first or dipped to 24,940 first. If your backtest optimistically assumes the target hit before the stop, it books a win; a realistic engine assumes the worst ordering and books the stop. The same bar can therefore produce opposite trade outcomes depending purely on an assumption the data cannot resolve.
NSE publishes a daily bhavcopy with official OHLC per symbol. Its close is the last-half-hour weighted average, not the last trade, so an end-of-day backtest fed on 3:29:59 last-traded-price will drift slightly from the exchange's settlement value used for margining.
Advantages
- Extremely compact — years of daily bars fit in a small file
- Uniform, gap-free time grid that indicators and charts expect
- Captures the interval's range (high minus low), enough for most strategies
- Cheap to store, fast to backtest over, easy to reason about
Limitations
- Discards the intrabar order of high and low — fatal for same-bar stop-vs-target logic
- A single bad high or low silently distorts range-based indicators (ATR, Bollinger, breakouts)
- Cannot model realistic fills, spread or slippage — there is no bid/ask in a bar
- Higher-timeframe bars are only as correct as the aggregation and session handling beneath them
- The 'close' may not match the exchange's official settlement price
Common mistakes
- Assuming a stop and a target inside the same bar resolve in your favour (optimistic intrabar assumption) — a classic hidden look-ahead-style bias
- Backtesting on unadjusted OHLC across a split or bonus, so a mechanical price jump reads as a real move
- Aggregating minute bars across the NSE lunch-free continuous session incorrectly, or across the overnight gap, producing corrupt daily bars
- Not validating that high >= max(open, close) and low <= min(open, close) — letting bad prints through
- Treating the OHLC 'close' as the exchange settlement price for margin or P&L reconciliation
- Using the current bar's close to generate a signal and then filling on that same close, which is not executable in real time
Professional usage
Professional desks treat OHLC as a derived, second-class artefact: they store and clean tick or full-depth data as the source of truth and generate bars on demand at whatever interval a strategy needs, with documented aggregation rules and session calendars. Bars used for research are reproducibly rebuilt from the same clean tick store used for execution simulation, so the backtest and the live path agree. Every bar series carries provenance metadata (source, adjustment status, timezone, session) so a quant can trust exactly what a 'daily close' means.
Key takeaways
- An OHLC bar records where price started, its extremes and where it ended — never the path between
- The lost intrabar ordering makes same-bar stop-versus-target outcomes an assumption, not a fact
- Validate high/low bounds and use adjusted prices, or one bad bar silently corrupts the whole backtest
- Prefer rebuilding bars from a clean tick store so research and live execution use identical data
Frequently asked questions
What does OHLC stand for?
What information does an OHLC bar hide?
Why can't I model a stop and target inside the same bar reliably?
Is the OHLC close the same as the last traded price?
What is the difference between OHLC and OHLCV?
Can I rebuild daily bars from minute bars?
How does bad OHLC data corrupt a backtest silently?
Which OHLC value is used most in strategies?
What bar intervals are common in Indian markets?
Do I need to adjust OHLC data for corporate actions?
Why does NSE's daily open differ from the first continuous trade?
Is OHLC data enough for backtesting?
How do I validate an OHLC bar?
What is the relationship between OHLC and candlestick charts?
Voice search & related questions
Natural-language questions people ask about OHLC Data.
What is OHLC data in simple terms?
What does an OHLC bar not tell me?
Is OHLC the same as a candlestick?
Why do people use the close price so much?
Can one bad price ruin my backtest?
How small can an OHLC bar be?
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.