Bar dataBeginner

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 compresses every trade in a period into just four prices plus volume, so a backtest cannot tell whether the high or low printed first. That single gap makes same-bar stop-versus-target outcomes an assumption, and one bad print silently distorts range indicators like ATR. Validate that high covers open, close and low, and use adjusted, session-correct bars.

Definition: OHLC Data

OHLC Data is price data that summarises each trading interval into four values — the open, high, low and close — one bar per period.

Key takeaways: OHLC Data

  • 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

OHLC Data at a glance

OHLC Data — key facts at a glance, Indian algorithmic-trading context.
StoresOpen, high, low, close and volume per interval
DiscardsThe intrabar path — the order high and low occurred
Common intervals1-min, 5-min, 15-min, daily, weekly
Failure modeOptimistic same-bar stop-versus-target ordering
Validation rulehigh greater-equal open/close/low; low less-equal all
NSE closeLast-30-min weighted average, not last tick
Indian sourceNSE/BSE daily bhavcopy

OHLC Data 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.

What OHLC Data is for

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.

OHLC Data — 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.

How OHLC Data looks visually

Data PipelineSource / FeedIngestNormaliseCorp-actionAdjustValidateStoreServe
How raw trades are aggregated into OHLC bars that feed indicators and signals.

Worked example: OHLC Data

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.

OHLC bars vs raw ticks

OHLC bars vs raw ticks — OHLC Data, summarised for Indian F&O context.
AspectOHLC barRaw ticks
Size4 numbers per intervalEvery trade/quote
Intrabar pathLostFully preserved
Storage costLowVery high
Fill modellingApproximatePrecise
Typical useMost bar strategiesMicrostructure, HFT

Advantages of OHLC Data

  • 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 of OHLC Data

  • 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

How professionals treat OHLC Data

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.

Common mistakes with OHLC Data

  • 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

OHLC Data: frequently asked questions

What does OHLC stand for?

OHLC stands for Open, High, Low and Close — the four prices that summarise one time interval. Open is the first trade of the interval, close the last, and high and low are the interval's extremes. With volume added it becomes OHLCV.

What information does an OHLC bar hide?

It hides the intrabar path — the sequence in which prices moved. You know the high and the low occurred, but not which came first, and you lose every individual trade and the bid-ask spread. This makes precise fill modelling impossible from bars alone.

Why can't I model a stop and target inside the same bar reliably?

Because OHLC does not record whether the high or the low printed first. If both your stop and target lie within one bar's range, the data cannot say which was hit first, so any backtest must make an assumption. A conservative engine assumes the unfavourable order.

Is the OHLC close the same as the last traded price?

Not always. On NSE the official daily close is a volume-weighted average of the last 30 minutes, whereas the last traded price is the final tick. They usually differ slightly, which matters for margining and settlement reconciliation.

What is the difference between OHLC and OHLCV?

OHLCV is simply OHLC plus Volume — the total quantity traded in the interval. Almost all real feeds ship volume with the four prices, and many strategies and indicators depend on it, so in practice most 'OHLC' data is OHLCV.

How does bad OHLC data corrupt a backtest silently?

A single erroneous high or low does not crash anything; it quietly inflates range-based indicators, triggers phantom breakouts or sets impossible stops. Across thousands of bars, a few poisoned values can shift performance metrics without any obvious single outlier, which is why validation is essential.

Sources & references

Published 10 July 2026. Educational content only — not investment advice. Markets and rules change; verify current conventions with SEBI, NSE/BSE and your broker.

Educational content only — not investment advice. Examples use illustrative numbers and simplified models. Algorithmic trading and derivatives involve substantial risk. See our Risk Disclosure and SEBI Disclaimer.