newTejHQ MCP is live: backtest Indian market data with your own AI agent
TEJHQ
All posts
·8 min read·TejHQ

Four out of five NSE F&O rows are not trades

Sixteen years of NSE F&O end-of-day data: 160 million rows, 81.53% with zero contracts, a holiday calendar we got wrong, and a put-call ratio test that mostly finds nothing.

#fo#options#open-interest#backfill#engineering

We now serve NSE F&O end-of-day data from 4 January 2010. For this post we ran everything on the rollups through 4 November 2026: 160,205,743 rows over 4,176 trading days, one row per contract per day. Of those rows, 130,622,528 have contracts = 0. That is 81.53%. Most of this dataset is a list of contracts that were available and that nobody traded that day.

This is the build log: what those rows do to naive analysis, what we got wrong in the backfill, and a put-call ratio test that did not find much.

by-year.txt
year   rows         no-trade   contracts (bn)   turnover (Rs lakh crore)
2010    6,694,411   92.97%       0.89                252
2015    7,481,408   87.28%       2.42                632
2020    9,153,959   82.43%       7.33              4,906
2022   16,010,037   82.38%      33.78             30,664
2024    9,976,806   65.45%     123.97             90,678
2025    8,772,732   57.92%      34.51             58,784
2026    8,422,420   59.97%      34.62             52,798   (to 4 Nov)

Five ways this file misleads you

A no-trade row still has a close. Open, high and low are zero, and close is the previous close carried forward. From 8 July 2024, when NSE's file also gives prev_close, that holds on all 12,691,381 no-trade rows. Of the stock options that expired in 2025, 42,568 of 193,152 (22.0%) never traded once and still had a close every day they were listed. Average those closes into a volatility surface and you are averaging old numbers. But do not drop the rows when you sum open interest: they held 0.73% to 2.88% of OI, depending on the year.

Contracts and open interest are in different units. contracts counts lots. open_interest counts units of the underlying. Since July 2024, on 8,152,219 traded rows where OI changed, the change is larger than contracts on 97.47% of them and larger than contracts times lot size on 0.05%.

A contract is not a fixed size. lot_size only exists from 8 July 2024, so we backed it out of older rows as turnover over contracts over price. On the near-month NIFTY future it came out as 50, then 25 from October 2014, 75 from October 2015, 50 from June 2021, 25 from April 2024, 75 from January 2025 and 65 from December 2025, with the odd one-day blip because the price is only the midpoint of the day's range. On the 578 days where NSE publishes the lot, the estimate matched every time. Lots also differ across expiries on the same day: NIFTY had both 25 and 75 on 1 January 2025. Total contracts fell 72.2% from 2024 to 2025 while turnover fell 35.2%. We have not split that between lot changes and fewer weekly expiries, but you should not read a contract series across those dates.

Option turnover is notional. On all 559,736 traded NIFTY option rows since the format change, turnover over contracts times lot, minus the strike, lands inside that day's premium range to within 50 paise. So it is strike plus premium, not premium paid. The table above is notional.

Close is not the last trade. In 2026, index futures had close equal to last price on 6.9% of traded rows and equal to settle price on 95.3%. Across all years, 10,566 of 1,975,695 traded futures rows have a close outside the day's high and low, and on 4,455 of them the high is zero despite non-zero contracts. We have not confirmed why and we leave them as NSE published them.

What we got wrong

The first backfill trusted a holiday calendar that did not know about special sessions. When we went back and asked NSE about all 2,001 non-session dates since 2010, 30 of them had files: Muhurat sessions, budget days, special Saturdays. The old calendar also had 14 November 2013 closed and 15 November open, when NSE shows the opposite. That added 26 F&O days. The calendar is now our own list.

The file formats were less trouble than the exceptions. The legacy fo04JAN2010bhav.csv runs to 5 July 2024 and UDiFF starts after it. On 5 July NSE published both, and all 33,930 rows match, with turnover agreeing within Rs 999.75. But the re-issued 14 May 2012 file has two-digit years (14-May-12) and ends with a blank line and *Updated. A compaction step keyed on (symbol, date) would have destroyed F&O rows, because NIFTY alone has 1,750 option rows on a median day this year, so it keys on the whole contract. Expiries can also move. On 27 June 2023 the front NIFTY future says it expires on the 29th, and on the 28th the same contract says the 28th, so a join on expiry breaks there.

Real gaps, which we will not paper over:

  • NSE has no F&O file for 9 October 2013 or 30 March 2021, though equities traded. The next day's oi_change does not equal the change between the rows you can see.
  • Two Sundays, 16 May 2010 and 11 November 2012, have equity files with only gold ETFs in them, 7 and 14 rows, and NSE has no F&O file for either day. Those are not gaps, since no derivatives session shows up, but a join on the equity calendar will find them.
  • oi_change equals the difference in OI on 99.98% of the 156,329,383 rows with a prior day. Of the 25,624 misses, 7,979 are on the two post-gap days. Another 1,292 are on 12 January 2026. The parser copies NSE's column unchanged and we do not know why those differ.

Does the put-call ratio tell you anything?

We took NIFTY put OI over call OI across all expiries, every day. The first result is that fixed levels mean nothing. The yearly mean was 0.94 in 2014, 1.46 in 2018 and 0.95 in 2025. Of the 395 days at 1.5 or above, 127 are in 2018 alone. So we ranked each day against its previous 252 sessions, which uses no future data, and regressed forward returns of the front-month future on that rank (0 to 1), over 3,923 days from January 2011.

pcr-test.txt
forward return                 rank slope     t      R-squared
next day, close to close        +0.118%      2.19    0.00117
next 5 days                     +0.208%      1.05    0.00073
next 20 days                    +0.186%      0.31    0.00015

next day, split in two
  overnight (close to open)     +0.075%      2.35
  next open to next close       +0.042%      0.87

Five and twenty days: nothing. Volume PCR: nothing at any of the three horizons (t of 0.85, 0.22 and -0.45). The one-day number passes the usual bar, and its sign is the same in all four sub-periods, though no single period gets past t = 1.49. It is also one hit from six tests, and the rank has a 0.37 correlation with the same day's return.

Most of it is the overnight gap, and you cannot trade that from an end-of-day file, which you read after the close. From the next open, the first price you can act on, the t is 0.87. Nothing here is net of costs. We read this as no usable signal.

The crash is a good reality check. On 23 March 2020 the front NIFTY future fell 13.09%. PCR that day was 1.03, the 15th percentile of its trailing year and well below the 2020 mean of 1.37. Nothing about it looked extreme. Index option contracts were down 36.4% on the day before and index futures down 42.3%, so the worst day was not the busiest. The chain did move:

nifty-26mar2020-expiry.txt
2020-03-23  future closed 7,581.55, from 8,723.10
strike  type    close   contracts   open_interest   oi_change
8000    PE     592.15     133,442         782,625  -1,136,550
8000    CE     173.35     170,604       1,239,075    +691,275
7500    PE     327.80     195,068       1,012,275    -601,275
7500    CE     400.00      20,393         445,200    +273,450

We also expected stock futures to hit their deepest discount to cash that day. They did not. The median near-month discount was 0.15%, only the 16th lowest of the 3,610 days we could measure, with 16 March 2020 at 0.60% and 29 May 2020 lowest at 0.70%. We have not worked out why May is the extreme.

Budget day, 1 February 2020, is the kind of session the old calendar could miss: a Saturday. The 12000 straddle expiring 6 February closed the day before at 295.50, or 2.46% of the future. The future then fell 339.40 points (2.83%) and the straddle closed at 377.90. NIFTY option contracts were 24.4% above their prior 20-day mean. That is one day and proves nothing about budget days in general.

Reproduce it

F&O is on the Retail plan and up, through the API only. It is not on HuggingFace or in the public bucket. Open interest comes back on every row, including no-trade rows, so this sums correctly:

pcr.py
from tej import Client

c = Client(api_key="tej_live_...")  # Retail or Pro

def pcr(symbol, date):
    puts = calls = 0
    for e in c.fo_expiries(symbol, date=date):
        if not e["instrument"].startswith("OPT"):
            continue
        for r in c.fo_chain(symbol, date=date, expiry=e["expiry"]):
            if r["option_type"] in ("PE", "PA"):
                puts += r["open_interest"]
            else:
                calls += r["open_interest"]
    return puts / calls

print(round(pcr("NIFTY", "2020-03-23"), 4))  # 1.0263

Filter on contracts > 0 when you read a price, not when you sum OI. The API returns a subset of the columns, including settle_price, oi_change and, from July 2024, underlying and lot_size.

Endpoints and the full column list are at /fo. Retail is ₹599/month, or pay once ₹599 for 30 days with no AutoPay. If you find a contract we have wrong, send it to github.com/tejhq/tej-bazaar. None of this is investment advice.