Skip to content

Two daily bars for the same day

You download the exchange’s end-of-day file and lay it against the daily candles your platform built by stacking its own intraday bars. The highs agree, the lows agree, and the closes do not — not on one day, on every day. Only one of the two is the number your rule was written about.

Technical AnalysisAdvanced13 min read
Browse Technical Analysis(123)

A rule that has run for months says: exit the position if the stock closes below ₹1,244. On Friday the alert does not fire, and on the same Friday a friend running the same rule from the exchange’s own end-of-day file exits. You pull the [[Bhavcopy]] to settle it. The official close for the day is ₹1,242.60. Your platform’s daily candle closes at ₹1,246.00. Both files are correct, both describe the same Friday, and the two numbers are not a discrepancy to be reported to anybody. They are answers to two different questions, and the rule never said which one it meant.

Think of it like this
The last ball and the run rate

Ask how an innings finished and you can be told the score off the final delivery, or the run rate through the last five overs. Both are honest summaries of the end of the innings and they answer different questions — one is a single event, the other is how the whole closing passage went. A commentator who switches between them without saying so will be understood to be contradicting himself.

In the market

The last traded price of the day is the final delivery. India’s official closing price is the run rate of the last thirty overs — a volume-weighted average designed so that one late ball cannot set it. Your chart shows one of them and the exchange publishes the other, and nothing on either screen announces which.

Five fields, and where each one comes from

FieldWhat the exchange publishesWhat a platform gets by stacking its own intraday bars
OpenThe first traded price of the session. For equities that price normally comes out of the pre-open call auction between 9.00 and 9.15; where the auction discovers no price, the first trade of the continuous session takes its place.The open of its first bar. If the feed’s first bar starts at 9.15 and excludes the pre-open match, this is the first continuous-market trade instead — a different price on any day the auction actually did some work.
High and lowThe highest and lowest traded prices of the session.Normally identical, because both are traded prices — unless the feed excludes the pre-open trade or includes a window the exchange does not count.
CloseThe volume-weighted average of the last thirty minutes of trading. Where there were no trades in that window, the last traded price stands in.The close of the last intraday bar, which is the last trade of the day. Different from the official figure on essentially every day on which price moved during the final half hour.
VolumeThe session’s traded quantity, on the segment and exchange the file covers.The sum of its bars. Whether the pre-open matched quantity and any post-session window are inside that sum is a convention, and conventions differ.
Previous closeThe previous session’s official close, which is what the day’s percentage change and the day’s price band are measured from.Whatever the platform carried forward — which, if it carried forward its own resampled close, is not the number the exchange used.
Worked example
The Friday in the opening paragraph
A large-cap that drifted up through the last half hour, with the rule set at ₹1,244
Price at 3.00 p.m., when the closing window opensThe thirty minutes from here are what the official close will be computed from₹1,239.80
The drift over the final half hourSteady buying into the close, of the sort that happens on any index-related dayUp to about ₹1,246 by the bell
Volume-weighted average of that half hourThe official close. It sits below the last trade because most of the window was traded lower₹1,242.60
The last trade of the sessionThe close of your platform’s final intraday bar, and therefore of its daily candle₹1,246.00
The rule: exit below ₹1,244A ₹3.40 difference in a single field, and the two systems now hold different positionsOfficial series: exit. Resampled series: hold
What that costs over a yearThe two closes are close together almost always. They differ enough to change a decision precisely on days when the last half hour moved — which is disproportionately the days that matteredNothing on most days and everything on a few
The important part is not the ₹3.40. It is that a backtest run on the exchange’s daily file and a live system reading a platform’s resampled daily candles are two different systems that look identical on paper. Every historical trade was decided on one definition of the close and every live trade is decided on another, and the divergence is not random noise — it is concentrated in exactly the sessions that had a directional final half hour.

The awkward consequence: you cannot know the close while you can still trade it

There is a second-order problem hiding in the definition, and it is the one that matters for testing. The official close is computed from the last thirty minutes, which means it does not exist until those thirty minutes are over. A rule that says buy at the close when the close is above the level is therefore asking you to transact at a price computed from the window you would have had to transact inside. That is not a small operational nuisance; it is a mild [[Look-ahead bias]] baked into a very common backtest.

  • The exchanges do run a [[Post-closing session]] — on the equity segment it has run from about 3.40 to 4 p.m. — in which orders may be entered at the closing price once it has been determined. That is the honest answer to “can I actually trade the close”, and it comes with two qualifications: your broker has to offer it, and somebody has to be on the other side, which in a thin name frequently means nobody is.
  • Trades in that window cannot change the closing price, because the price was already determined before the window opened. They can, however, land inside a volume figure depending on the convention, which is one more reason two volume bars disagree.
  • A signal computed on the close and executed the next morning is the clean and testable version, and it is what most daily systems in this track quietly assume. It has a cost — an overnight gap between the signal and the fill — and that cost is real, measurable and much better than an untestable assumption.
  • Modelling a close-execution as an average of the last half hour is the other defensible route, because that is approximately what the official close is. It is more work and it is closer to what would actually have happened to someone working an order into the close.
  • What is not defensible is filling at the official close in a backtest and treating it as free. That is the version almost every spreadsheet does by default, because the close is the column that is sitting right there.

The audit, on one day, once

  1. 1
    Pick a day on which the last half hour clearly trended

    A flat afternoon will make the two closes agree and tell you nothing. Choose a session where the stock moved half a per cent or more after three o’clock.

  2. 2
    Compare five numbers, not one

    Open, high, low, close and volume, from the exchange file against your platform’s daily candle. Note which agree exactly and which do not — the pattern of agreement tells you how your series was built.

  3. 3
    If only the close differs, your series is resampled

    That is the signature: traded prices agree, the computed one does not. It is not a fault, and it does mean your daily closes are last-trade prices rather than official ones.

  4. 4
    If the open differs too, look at the pre-open

    A platform whose first bar begins at 9.15 and ignores the [[Pre-open session]] match will show a different open on any day the auction discovered a price away from the previous close — which is to say, on the days that mattered.

  5. 5
    Write down which series your rules are written on

    One line, next to the bar size and the anchor from the first lesson. Official daily closes from the exchange file, or your platform’s resampled candles. Both are workable. Testing on one and trading on the other is not.

Check yourself

Your platform builds its daily candles by stacking its own five-minute bars. Which field will differ from the exchange’s published daily bar on almost every session, and why?

Simple bhasha mein
Mandi ka bhaav aur aakhri grahak ka bhaav

Mandi ke board pe aaj ka bhaav ₹22 likha hai, jo aakhri kuch ghanton ke saudon ka average hai. Aakhri grahak ne ₹26 diya kyunki maal khatam ho raha tha. Dono number sach hain aur dono alag sawaal ka jawab hain. Exchange ka official close bhi average hai — aakhri tees minute (3.00 se 3.30) ka volume-weighted average — taaki koi ek aakhri sauda din ka bhaav tay na kar de. Aapka app apni intraday candle jod ke daily candle banata hai, toh uska close aakhri trade hota hai. Us Friday ko 3 baje bhaav ₹1,239.80 tha aur ghanti tak dheere-dheere ₹1,246 pahuncha: official close ₹1,242.60, app ka close ₹1,246.00, farq ₹3.40. Rule tha "₹1,244 ke neeche band ho toh nikal jao" — exchange ki file dekhne wala nikal gaya, app dekhne wala baitha rah gaya, aur dono ne rule poora follow kiya. Bhavcopy muft hai: ek din uthao aur paanch column milao — open, high, low, close, volume — sirf ek nahi.

What to remember
  • India’s official daily close is a volume-weighted average of the last thirty minutes, not the last trade.
  • A daily candle built by stacking intraday bars closes at the last trade, so it disagrees with the exchange file on essentially every moving session.
  • The open can differ too, if the platform’s first bar excludes the pre-open auction match.
  • The official close does not exist until the window it is computed from has ended, so “buy at the close” in a backtest is a mild look-ahead unless it is modelled honestly.
  • The bhavcopy is free, primary and settles the question in two minutes — check five fields, not one.
Finished this lesson?

Mark it done to track your progress through the curriculum.