Markets: A Rigorous Course

9A.2 The chain from the F&O bhavcopy

Core about 10 min

Motivation

Live chains come from exchange or broker feeds that a learner may not be able to store or reproduce. The end-of-day bhavcopy is free, complete, and archived, and it is the dataset this module's tests use.

9A.2.1The UDiFF file and the chain#

The file NSE publishes the F&O bhavcopy in the UDiFF format at

https://nsearchives.nseindia.com/content/fo/BhavCopy_NSE_FO_0_0_0_YYYYMMDD_F_0000.csv.zip

(NSE archive; files for every trading day used in this module were downloaded on 6 Nov 2026). Each row is one contract. The columns used here are TckrSymb (underlying), FinInstrmTp (IDO index option, STO stock option, IDF/STF futures), XpryDt (expiry), StrkPric, OptnTp (CE/PE), ClsPric, LastPric, PrvsClsgPric, UndrlygPric, SttlmPric, OpnIntrst, ChngInOpnIntrst, TtlTradgVol and NewBrdLotQty (lot size).

Building the chain Filter TckrSymb == "NIFTY", FinInstrmTp == "IDO", one XpryDt; pivot on strike and option type. The exercise m09a_chain.build_chain does this and is tested on the 26 Oct 2026 file (144 strikes for the 27 Oct expiry).

9A.2.2Pitfalls and other daily files#

Pitfalls found in the 2026 files

  1. Settlement price of expiring options. On an expiry day, SttlmPric of the expiring Nifty options holds the underlying's final settlement value (22,749.75 on 27 Oct 2026 for every strike), not an option price. Use ClsPric for option values and compute payoffs from the settlement value.
  2. Holiday expiries. Nifty options expire on Tuesday since 1 Sep 2025, moving to the previous trading day when Tuesday is a holiday (NSE circulars NSE/FAOP/68589 and NSE/FAOP/68747 of June 2025). The 2026 files show Monday expiries on 13 Apr and 19 Oct 2026, and the 5 Nov 2026 file lists 9 Nov and 23 Nov 2026, both Mondays. Never compute expiries from the calendar; read XpryDt.
  3. Units. OpnIntrst and ChngInOpnIntrst are in units (contracts × lot): every value in the 26 Oct 2026 Nifty rows is a multiple of 65. TtlTradgVol is in contracts: most values are not multiples of 65, and TtlTrfVal/(TtlTradgVol × 65) equals strike plus premium for options and the futures price for futures, so TtlTrfVal is notional turnover, not premium. (This reading is inferred from the file itself; NSE's UDiFF field documentation was not consulted.) Ratios of volume to volume (PCR) are unaffected; comparisons of ΔOI with volume need a conversion. Lot sizes change (Nifty 75 to 65 for contracts expiring after 30 Dec 2025), so contract counts are not comparable across that date; units are.
  4. Stale prices. A strike with zero volume still has a closing price. On 7 Oct 2026 the 9 Nov expiry had almost no trades, and its closing prices implied an ATM IV of 16.1% while its settlement prices implied 13.3% and the neighbouring expiries 12.9–13.0%. Filter by volume before computing IV.
  5. Bid and ask are absent. The bhavcopy has no quotes, so spreads must come from elsewhere. Treat close-based IVs as having an error of at least half a typical spread divided by vega.

Other daily files The participant-wise OI file (9A.11) is at https://nsearchives.nseindia.com/content/nsccl/fao_participant_oi_DDMMYYYY.csv. NSE's live option-chain web API requires session cookies and blocks automated access (observed when this module was prepared, Nov 2026); do not build research on it.

Create a free account

Reading is open to everyone. An account keeps your progress, answers, notes and code drafts, and gives you the study plan, the journals and the simulator. Running code needs an account approved for it.