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

Data PipelineSource / FeedIngestNormaliseCorp-actionAdjustValidateStoreServe

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

AspectOHLC barRaw ticks
Size4 numbers per intervalEvery trade/quote
Intrabar pathLostFully preserved
Storage costLowVery high
Fill modellingApproximatePrecise
Typical useMost bar strategiesMicrostructure, 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?
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.
Can I rebuild daily bars from minute bars?
Yes. The daily open is the first minute's open, the daily high the maximum of minute highs, the daily low the minimum of minute lows, and the daily close the last minute's close — provided you respect the session boundaries and do not aggregate across gaps.
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.
Which OHLC value is used most in strategies?
The close. Most indicators are computed on closing prices, most signals are evaluated at the bar close, and most end-of-day systems act on it. This makes the correctness and definition of 'close' unusually important.
What bar intervals are common in Indian markets?
1-minute, 5-minute, 15-minute and daily are the most common for retail systematic trading, with weekly and monthly used for longer-horizon analysis. The NSE equity and F&O session runs 9:15 to 15:30, which bounds intraday aggregation.
Do I need to adjust OHLC data for corporate actions?
Yes, for any series spanning a split, bonus or dividend. Unadjusted OHLC shows a mechanical price jump on the ex-date that is not a real market move, which can trigger false signals and corrupt indicators. Use adjusted prices for research.
Why does NSE's daily open differ from the first continuous trade?
Because NSE runs a pre-open call auction from 9:00 to 9:15 that discovers a single opening price. That auction price is the official open, not necessarily the first trade in the continuous session that follows.
Is OHLC data enough for backtesting?
For most bar-based strategies with holding periods of minutes to days, yes — provided it is clean and adjusted. It is insufficient for microstructure strategies, precise fill and slippage modelling, or anything needing the bid-ask spread, where tick or quote data is required.
How do I validate an OHLC bar?
Check that the high is greater than or equal to the open, close and low, and that the low is less than or equal to the open, close and high. Also check volume is non-negative and the timestamp falls inside a valid trading session. Bars failing these are corrupt.
What is the relationship between OHLC and candlestick charts?
A candlestick is a visual rendering of one OHLC bar: the body spans open to close and the wicks reach to the high and low. Candlesticks and OHLC bars contain exactly the same four numbers; only the drawing differs.

Voice search & related questions

Natural-language questions people ask about OHLC Data.

What is OHLC data in simple terms?
It is a summary of one time period using four prices — the opening price, the highest and lowest prices, and the closing price. It is a compact way to describe how price behaved over that interval.
What does an OHLC bar not tell me?
It does not tell you the order in which price moved inside the interval, so you can't know whether the high or the low came first, and you lose every individual trade.
Is OHLC the same as a candlestick?
Yes, they hold the same four numbers. A candlestick is just a picture of an OHLC bar, with a body from open to close and wicks to the high and low.
Why do people use the close price so much?
Because most indicators and trading signals are calculated on the closing price of each bar, so it ends up being the single most important number in a bar.
Can one bad price ruin my backtest?
Yes. A single wrong high or low won't crash your program, but it can quietly distort your indicators and trigger fake signals, so you should always validate the data first.
How small can an OHLC bar be?
As small as one minute, or even less on some feeds. The smaller the interval, the more bars you get and the closer you approach a full tick record.

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.

    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.