Ten Years of Indian Stock Market Data, and Why Raw Prices Lie

A clean, point-in-time dataset of every NSE stock from 2016 to 2026: why raw exchange prices break at every split, how the breaks were found and fixed, and a leak-free ML baseline on top.
Data Engineering
Finance
Machine Learning
Author
Published

October 14, 2026

Behind the scenes: How the NSE India Stock Dataset Was Built covers the pipeline itself, from downloading to the checks that run before every release.

Any study of stock returns starts with a price history you can trust. For Indian stocks that turns out to be much harder than it sounds, and most of the work goes into problems that aren’t obvious at first.

This post covers what goes wrong with raw NSE data and how it was fixed. The result is a free dataset on Kaggle: adjusted daily prices for 3,986 NSE stocks (5 million rows), quarterly financials, insider trades, bulk deals, foreign investor flows, and 96 ready-made features for machine learning.

Dataset: NSE India Stocks 2016–2026: Adjusted Panel

Raw prices are not adjusted

The National Stock Exchange of India publishes a daily file called the bhavcopy: open, high, low, close and volume for every listed security. It’s public, complete, and goes back decades.

It’s also completely unadjusted. When a company does a 1:1 bonus issue, the number of shares doubles and the price halves overnight. The bhavcopy records that as a 50% crash. Every return, moving average and 52-week high computed across that date is wrong.

Bajaj Finance is a good example. In June 2025 it did a split and a bonus on the same day, ten times the shares in total:

Bajaj Finance around its June 2025 split and bonus. Left: the raw close, which drops about 90% overnight. Right: the adjusted close, which is continuous.

The official feed only explains half the breaks

NSE also publishes a corporate-action feed that lists splits and bonuses. It helps, but it can’t be trusted on its own:

  • The previous close is never restated on ex-dates. Of 843 split and bonus events, the “previous close” field was corrected on exactly zero.
  • About half the breaks have no matching record. Of 1,031 large overnight drops in liquid stocks, only 512 matched the feed. The rest were demergers, rights issues, missing records, and real crashes.
  • Some companies have no records at all. Tata Motors has zero across 11 years.
  • Older records are abbreviated. In 2016 and 2017 splits were written as Fv Splt Frm Rs 10 To Re 1. A parser looking for “split” misses all of them, including JSW Steel’s 10:1 split.

So the prices themselves have to be read for evidence too.

Reading the breaks out of the prices

Every large overnight jump is treated as an event that needs an explanation:

flowchart TD
  J[Large overnight jump] --> F{Split or bonus<br/>in the feed?}
  F -- "yes, ratio fits" --> A[Adjust by the feed's factor]
  F -- no --> D{Demerger, rights<br/>or scheme?}
  D -- yes --> M[Mask the day]
  D -- no --> C{Clean ratio?<br/>2x, 5x, 10x}
  C -- yes --> A2[Adjust as a missed split]
  C -- no --> R[Mask and send for review]

Demergers get masked rather than adjusted because the right factor depends on what the spun-off business was worth, and that isn’t in any dataset.

Each rule in that chart came from a bug:

  • Too many allowed ratios erase real crashes. An early version allowed every bonus ratio, like 5:12 or 7:10. They sit so close together that Yes Bank’s real 2020 collapse “snapped” to a 5:12 bonus and vanished. A short list of clean ratios fixed it.
  • Penny stocks break the maths. At ₹0.10, a single price tick is a 1.5× move. One stock collected 163 fake “splits” and a cumulative factor of 10⁴². Inference now needs a minimum price and liquidity.
  • Circuit limits distort the ratio. Fitted factors were often off by exactly 0.1667. NSE resets the 20% price band on an ex-date, and hot small caps close at the upper limit, so a correct 5:1 split shows up as a ×4.17 jump.
  • Some cases need a human. Checking every unexplained break on a liquid stock against news and filings found 17 corporate actions the feed never reported, including splits at United Spirits and HEG.

Real crashes stay in the data: Yes Bank’s moratorium day, DHFL, Jet Airways. Removing them would make every long-only backtest look better than it should. Every decision is logged in price_events.csv, with its reason.

Every detected price break by year, split by where the explanation came from (left), and what was done with each kind (right).

Time is the other half of the problem

Clean prices aren’t enough. You also need to know when each piece of information became public. Using it a day early is look-ahead bias, the most common reason backtests fail in real trading.

  • Quarterly results are dated by the exchange broadcast time, not the quarter end. Two thirds come out after market hours, so the first session that can react is usually the next one.
  • Insider trades reach the market a median of 3 days after the trade, and more than 12,000 disclosures arrived over a month late.
  • Foreign flows and US markets are published after India closes, so they’re lagged one session.

Days between an insider trade and its public disclosure. Anything 30 days or later is piled into the last bar. Joining on the trade date quietly leaks the future into a backtest.

Every event row has an EVENT_DATE: the first session the market could have reacted.

The best check for all of this was rebuilding the whole price panel as if it were 1 January 2024, with no later corporate action known, and comparing it with the full build. Returns, turnover and the tradable-universe flag matched on all 3.37 million rows before that date.

What’s in the dataset

Part What it contains
Prices Adjusted daily OHLC, VWAP, volume, delivery % and total return (dividends included) for every NSE stock, 2016–2026, delisted ones included
Price events Every detected break, how it was classified, and whether it was adjusted or masked
Corporate actions NSE’s feed, parsed: dividends, splits, bonuses, rights, demergers, buybacks
Fundamentals Every quarterly results filing since 2016, with revenue, profit and EPS
Ownership SEBI insider-trading disclosures, plus bulk and block deals
Flows Daily foreign portfolio investment (NSDL) and F&O positioning by FIIs, DIIs, retail and prop traders
ML features 96 point-in-time features with forward-return labels, for the liquid universe only

Three details that matter in practice:

  • No survivorship bias. 1,047 of the 3,986 symbols stopped trading before the end. Failed and merged companies are in the data.
  • A tradable-universe flag. ELIGIBLE marks stocks with enough turnover, a sensible price and enough history, computed from past data only. It cuts thousands of thinly traded names to the few hundred you could actually buy.
  • Delivery data. India publishes how much of each day’s volume was actually delivered rather than squared off intraday. Few markets have this.

Stocks traded per day, and how many pass the ELIGIBLE filter. The dip in 2019 is real: small-cap turnover dried up after the 2018 sell-off.

Does any of it predict returns?

To show how the data is meant to be used, there’s a leak-free ML baseline: LightGBM on the 96 features, trained only on the past and tested year by year from 2020, with a gap between train and test so overlapping labels can’t leak.

The result is more useful than a clean win would have been:

  • The model ranks stocks better than momentum. Its average daily rank correlation (IC) with future returns was 0.056, against 0.031 for 12-month momentum, and it held up in every test year.
  • Momentum still made the better portfolio. Buying momentum’s top 10% every two weeks beat the market average by about 13% a year after trading costs. The model’s top 10% roughly broke even.

Rank IC over time, 120-day rolling mean. The model (blue) stays above zero almost throughout; momentum (orange) swings more.

Cumulative excess return of each top-10% portfolio over the liquid universe. Solid lines are after trading costs.

Two things explain the gap. Most of the model’s skill is in spotting losers: its bottom 10% lags about twice as much as its top 10% leads, and a long-only investor can’t use that. Its picks also change a lot between rebalances (about 64% of the portfolio each time, against 22% for momentum), so trading costs eat most of what’s left at the top.

A higher accuracy score doesn’t automatically mean a better strategy, and you only see that if the test itself is honest.

Lessons for anyone building market data

  1. Never trust a price series you haven’t checked for breaks. Plot a few known splits first.
  2. The official corporate-action feed is a hint, not the truth. Read the prices too.
  3. Every row needs a “known since” date. Most look-ahead bugs come from event data, not prices.
  4. Write the look-ahead test early. Rebuilding history as of a past date and diffing it is cheap and catches the most mistakes.
  5. Look at the extremes. The biggest values in a column are where unit errors live. One insider filing implied a share price 100 times too high, and only a chart of totals showed it.

Get the data

The data is compiled from public sources: the National Stock Exchange of India, NSDL and BSE, who own the original data. The cleaning, adjustment and features are shared under CC BY-NC 4.0 for research and education. Nothing here is investment advice.