Rajandran R Creator of OpenAlgo Sketchmaker, RagZ. Building GenAI Applications. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Now the recent curiosity on building Trading AI Agents.

Use a Point-in-Time Index Universe in Python

7 min read

Abstract editorial graphic of index cards and a timeline for a point-in-time index universe tutorial, with no text.

This is a Python tutorial, not a strategy recommendation. A point-in-time index universe lets you look up who was actually in an Indian equity index on any past date, instead of dropping today’s list into a backtest. Of the 50 Nifty 50 members on 1 January 2015, only 30 are still in the index on 30 November 2026, and 87 different companies have passed through the list.

Marketcalls built and published this dataset under the MIT License. The public repository covers 41 Indian equity indices, is updated monthly, and can be queried from Python after a plain git clone.

Why a point-in-time index universe beats today’s list

Today’s Nifty 50 is a list of companies that are in the index now. A stock usually gets there by growing large enough, so any name on that list has, by definition, already done well at some point. If a backtest ranks today’s 50 names all the way back through 2015, it is giving the test information that a trader in 2015 did not have.

Build desktop apps with Claude Code
LIVE COURSE · DEC 2026

Build desktop apps with Claude Code

Plan, build, package and distribute desktop apps for Windows, macOS and Linux, with Claude Code as your development partner.

  • 5 live sessions, 10 hours, starts 7 December 2026
  • CRM, algo trading and NSE Bhavcopy projects
  • Installers for Windows, macOS and Linux
Join the course →by Marketcalls

That leak has a name: survivorship bias. The names that later shrank, merged or were dropped never appear, and the names that were added later are treated as if they had been eligible the whole time. It sits beside look-ahead bias. That is the broader habit of letting a test see data that was not available at the time.

The cost of that shortcut is not small. In our Nifty 100 momentum backtest without survivorship bias, the same rules showed a 21.5% compound annual return on today’s Nifty 100 list. They returned 7.8% once each month’s rank used the stocks that were actually in the index on that date. This tutorial does not rerun that test. It shows how to get the membership list itself, for 41 indices, and how to query it in Python.

What the public repository holds

The point-in-time index universe lives at marketcalls/india-index-pit-universe on GitHub, under the MIT License. The public build used in this tutorial runs from 1 January 2015, or from each index’s launch date, through 30 November 2026.

broad/ holds ten main indices: Nifty 50, SENSEX, Nifty Bank, Nifty Next 50, Nifty 100, Nifty 500, Nifty Midcap 150, Nifty Smallcap 250, Nifty Financial Services and Nifty IT. Midcap 150 and Smallcap 250 start on 1 April 2016, their launch date. sectoral/ holds the other 31 indices on the NSE Indices sectoral page, including later launches such as Nifty Healthcare (2020) and the group of sectoral indices that started on 15 June 2026.

For each index the repository stores a dated add-and-remove log and month-end snapshots as both Parquet and CSV. It also stores membership spells, which are the exact start and end of each company’s stay, plus a validation file and a coverage note. A small Python helper, pit_universe.py, reads those files so you do not have to parse them by hand. The published change logs and snapshots are enough to look up members.

The histories are an independent reconstruction from official change announcements and archived official lists, not official exchange files republished in full.

How to download the dataset from GitHub

You need Git, Python 3.10 or later, and two packages, pandas and pyarrow. From a terminal:

git clone https://github.com/marketcalls/india-index-pit-universe.git
cd india-index-pit-universe
pip install pandas pyarrow

From the repository root you can also run pip install ., which reads the same dependencies from pyproject.toml. If you use uv, uv venv and uv pip install pandas pyarrow work the same way. Run Python from that repository root so the data files sit beside the helper module.

The dataset is refreshed around the start of each month. In a clone you already have, the update is:

git pull

Look up a point-in-time index universe in Python

Four helpers do most of the work: indices(), coverage(), members() and history().

from pit_universe import members, history, indices, coverage

print(len(indices()), "indices")
print(indices("broad"))
print(len(indices("sectoral")), "sectoral")
print(coverage("NIFTY50"))
print(coverage("NIFTYMIDCAP150"))
41 indices
['NIFTY50', 'SENSEX', 'NIFTYBANK', 'NIFTYNEXT50', 'NIFTY100', 'NIFTY500', 'NIFTYMIDCAP150', 'NIFTYSMALLCAP250', 'NIFTYFINSERV', 'NIFTYIT']
31 sectoral
(datetime.date(2015, 1, 1), datetime.date(2026, 11, 30))
(datetime.date(2016, 4, 1), datetime.date(2026, 11, 30))

members(index, date) returns the tickers that were in force on that date. A change with effective date E applies from the trading session of E, after the previous session’s close. Names such as "NIFTY 50" or "Nifty Midcap 150" are accepted as well as the short keys. Dates before an index’s coverage start raise an error, so Midcap 150 cannot be asked for a 2015 date. Dates after 30 November 2026, the current build’s last day, return the latest membership and emit a warning.

The same companies can be returned under the ticker they used on that date (symbols="asof", the default) or under today’s ticker (symbols="current"). Current tickers are the fair way to compare two dates, because a rename is not an exit.

then = members("NIFTY50", "2015-01-01", symbols="current")
now = members("NIFTY50", "2026-11-30", symbols="current")
print(len(then), "members on 2015-01-01")
print(len(now), "members on 2026-11-30")
print(len(set(then) & set(now)), "names remain")
print("left:", sorted(set(then) - set(now)))
print("joined:", sorted(set(now) - set(then)))
50 members on 2015-01-01
50 members on 2026-11-30
30 names remain
left: ['ACC', 'AMBUJACEM', 'BANKBARODA', 'BHEL', 'BPCL', 'CAIRN', 'DLF', 'GAIL', 'HDFC', 'HEROMOTOCO', 'IDFC', 'INDUSINDBK', 'JINDALSTEL', 'LUPIN', 'NMDC', 'PNB', 'TATAPOWER', 'VEDL', 'WIPRO', 'ZEEL']
joined: ['ADANIENT', 'ADANIPORTS', 'APOLLOHOSP', 'BAJAJFINSV', 'BAJFINANCE', 'BEL', 'BSE', 'EICHERMOT', 'ETERNAL', 'HDFCLIFE', 'INDIGO', 'JIOFIN', 'JSWSTEEL', 'MAXHEALTH', 'NESTLEIND', 'SBILIFE', 'SHRIRAMFIN', 'TATACONSUM', 'TITAN', 'TRENT']

Tickers as they traded, or as they trade today

On 1 January 2015 two Nifty 50 names do not match today’s tickers. Tata Motors traded as TATAMOTORS and is TMPV today. Vedanta traded as SSLT and is VEDL today. Vedanta later left the index; Tata Motors, under TMPV, is still in it, which is why the comparison above uses current tickers.

The same rule shows up on later add dates. Zomato was added to the Nifty 50 on 28 March 2025. On that date members(..., symbols="asof") includes ZOMATO, and members(..., symbols="current") includes ETERNAL, today’s ticker for the same company. On 27 March 2025, the day before the add, ETERNAL is not in the list.

history(index) returns the month-end snapshots as a pandas DataFrame. history(index, kind="changes") returns every dated add and remove, with the change announcement recorded on each row. history(index, kind="spells") returns the membership intervals that members() uses. You can also read the files directly:

import pandas as pd

snap = pd.read_parquet("broad/snapshots/NIFTY50.parquet")
print(list(snap.columns))
print(snap["date"].nunique(), "month-ends;", len(snap), "rows")
print(snap["date"].min().date(), "to", snap["date"].max().date())
['date', 'symbol', 'current_symbol', 'isin', 'company', 'is_extra']
143 month-ends; 7173 rows
2015-01-31 to 2026-11-30

The is_extra flag marks a short-lived demerger dummy line or a similar additional security, such as the Tata Motors DVR in 2016 and 2017. Those lines can push a month-end count one above the nominal size.

What happened to the 2015 Nifty 50

Of the 50 companies in the Nifty 50 on 1 January 2015, 30 are still in the index on 30 November 2026. Twenty have left, and 20 companies that were not in the 2015 list are in it now. Another 17 companies entered after January 2015 and later left, which is how 87 different companies have passed through the index in this window.

A backtest that uses today’s 50 names in 2015 is therefore testing 20 companies that were not in the index then, and missing 20 that were. The same pattern shows up one level broader. Only 60 of today’s Nifty 100 members were in that index on 1 January 2015, and 192 different companies have passed through Nifty 100 in this dataset. That is the leak the earlier Nifty 100 momentum strategy backtest carried when it used today’s list for the whole period.

Left the Nifty 50Joined the Nifty 50
ACC Ltd. (ACC)Adani Enterprises Ltd. (ADANIENT)
Ambuja Cements Ltd. (AMBUJACEM)Adani Ports and Special Economic Zone Ltd. (ADANIPORTS)
Bank of Baroda (BANKBARODA)Apollo Hospitals Enterprise Ltd. (APOLLOHOSP)
Bharat Heavy Electricals Ltd. (BHEL)Bajaj Finserv Ltd. (BAJAJFINSV)
Bharat Petroleum Corporation Ltd. (BPCL)Bajaj Finance Ltd. (BAJFINANCE)
Cairn India Ltd. (CAIRN)Bharat Electronics Ltd. (BEL)
DLF Ltd. (DLF)BSE Ltd. (BSE)
GAIL (India) Ltd. (GAIL)Eicher Motors Ltd. (EICHERMOT)
Housing Development Finance Corporation Ltd. (HDFC)Eternal Ltd. (ETERNAL)
Hero MotoCorp Ltd. (HEROMOTOCO)HDFC Life Insurance Company Ltd. (HDFCLIFE)
IDFC Ltd. (IDFC)InterGlobe Aviation Ltd. (INDIGO)
IndusInd Bank Ltd. (INDUSINDBK)Jio Financial Services Ltd. (JIOFIN)
Jindal Steel & Power Ltd. (JINDALSTEL)JSW Steel Ltd. (JSWSTEEL)
Lupin Ltd. (LUPIN)Max Healthcare Institute Ltd. (MAXHEALTH)
NMDC Ltd. (NMDC)Nestle India Ltd. (NESTLEIND)
Punjab National Bank (PNB)SBI Life Insurance Company Ltd. (SBILIFE)
Tata Power Co. Ltd. (TATAPOWER)Shriram Finance Ltd. (SHRIRAMFIN)
Vedanta Ltd. (VEDL)Tata Consumer Products Ltd. (TATACONSUM)
Wipro Ltd. (WIPRO)Titan Company Ltd. (TITAN)
Zee Entertainment Enterprises Ltd. (ZEEL)Trent Ltd. (TRENT)
Line chart of 2015 Nifty 50 members still in the index at each year-end, falling to 30 by 30 November 2026.
Members of the 1 January 2015 Nifty 50 still in the index at each year-end, using current tickers.
Summary card showing that 30 of the 50 Nifty 50 members from 1 January 2015 remain in the index on 30 November 2026.
30 of the 2015 Nifty 50 remain in the index as of 30 November 2026.

How often the constituent lists change

The Nifty 50 change log in this build has 80 add and remove events from 2015 through 30 November 2026. The busiest years were 2017 and 2025, with 13 events each. The quietest year was 2021, with two events. 2026, through 30 November, has three.

ch = history("NIFTY50", kind="changes")
print(len(ch), "events")
print(ch.assign(year=ch.effective_date.dt.year).groupby("year").size().to_string())
80 events
year
2015     8
2016     7
2017    13
2018     8
2019     4
2020     8
2021     2
2022     4
2023     4
2024     6
2025    13
2026     3

Each add or remove counts as one event, including short-lived demerger dummy lines, so a year with 13 events is not 13 lasting replacements. The 2025 total, for example, includes the temporary dummy lines created when ITC Hotels and then the Tata Motors commercial-vehicles business were spun off.

Bar chart of Nifty 50 adds and removes each year from 2015 to 30 November 2026, peaking at 13 events in 2017 and 2025.
Nifty 50 add and remove events by year, 2015 through 30 November 2026.

The broader indices move more. Nifty 500 has 1,471 events in the same window, and 984 different companies have passed through it. 2016 alone had 211 of those events, 157 of them in April, the month Nifty Midcap 150 and Nifty Smallcap 250 were launched. On 30 November 2026, Nifty 500 stands at 501 lines and Nifty Smallcap 250 at 251, each with one line flagged as an extra security.

IndexCovered fromMembers thenMembers on 30 Nov 2026Companies ever in the indexAdd and remove events
Nifty 501 January 201550508780
SENSEX1 January 201530305460
Nifty Bank1 January 201512141714
Nifty Next 501 January 20155050151306
Nifty 1001 January 2015100100192278
Nifty 5001 January 20155005019841,471
Nifty Midcap 1501 April 2016150150369638
Nifty Smallcap 2501 April 20162502517061,381
Nifty Financial Services1 January 201515203847
Nifty IT1 January 201520102540

SENSEX event counts in the table exclude two changes that are already in the log but have not yet taken effect: on 21 December 2026, Trent leaves and Shriram Finance joins. Asking members() for a date after 30 November 2026 still returns the 30 November list and warns that the build has not been updated.

How the histories were checked

The reconstruction starts from the official constituent lists as of 30 November 2026 and rolls backward through the dated official change announcements. The result is then compared with archived official constituent files. In this build there are no unexplained mismatches. On every change date Nifty 100 equals Nifty 50 plus Nifty Next 50. From 1 April 2016, Nifty 500 equals Nifty 100 plus Midcap 150 plus Smallcap 250, after the known extra lines are set aside. Nifty 50 alone matches 33 archived official lists exactly, with two further files matching an earlier official state that the website had not yet refreshed. That is how this point-in-time index universe was checked.

A full script for a point-in-time index universe

The snippets above can be run one block at a time. The script below is the complete version. Save it as lookup_point_in_time_universe.py in the repository root, then run python lookup_point_in_time_universe.py. It prints the index list, the 2015 versus 2026 Nifty 50 comparison, the ticker changes, the Zomato add-date check, the yearly event counts and the unique-company totals used in this tutorial.

"""Look up point-in-time Indian index constituents.

Run this from the root of a clone of
https://github.com/marketcalls/india-index-pit-universe

    git clone https://github.com/marketcalls/india-index-pit-universe.git
    cd india-index-pit-universe
    pip install pandas pyarrow
    python lookup_point_in_time_universe.py

Requires Python 3.10 or later. The figures in the accompanying tutorial
were produced from the 30 November 2026 public commit of this repository.
"""
from pit_universe import members, history, indices, coverage, symbol_on
import pandas as pd

print("indices:", len(indices()))
print("broad:", indices("broad"))
print("sectoral:", len(indices("sectoral")))
print("coverage NIFTY50:", coverage("NIFTY50"))
print("coverage NIFTYMIDCAP150:", coverage("NIFTYMIDCAP150"))

then = members("NIFTY50", "2015-01-01", symbols="current")
now = members("NIFTY50", "2026-11-30", symbols="current")
print("members on 2015-01-01:", len(then))
print("members on 2026-11-30:", len(now))
print("names that remain:", len(set(then) & set(now)))
print("left:", sorted(set(then) - set(now)))
print("joined:", sorted(set(now) - set(then)))

print("ticker changes on 2015-01-01:")
for current in members("NIFTY50", "2015-01-01", symbols="current"):
    asof = symbol_on(current, "2015-01-01")
    if asof != current:
        print(f"  {asof} -> {current}")

print("Zomato on add date 2025-03-28, as traded:",
      "ZOMATO" in members("NIFTY50", "2025-03-28", symbols="asof"))
print("same day, current ticker ETERNAL:",
      "ETERNAL" in members("NIFTY50", "2025-03-28", symbols="current"))
print("day before, current ticker ETERNAL:",
      "ETERNAL" in members("NIFTY50", "2025-03-27", symbols="current"))

ch = history("NIFTY50", kind="changes")
print("Nifty 50 change columns:", list(ch.columns))
print("Nifty 50 events:", len(ch))
yearly = ch.assign(year=ch.effective_date.dt.year).groupby("year").size()
print(yearly.to_string())

snap = pd.read_parquet("broad/snapshots/NIFTY50.parquet")
print("parquet columns:", list(snap.columns))
print("month-ends:", snap["date"].nunique(), "rows:", len(snap))
print("range:", snap["date"].min().date(), "to", snap["date"].max().date())

print("unique companies ever in NIFTY50:",
      history("NIFTY50", kind="spells")["current_symbol"].nunique())
print("unique companies ever in NIFTY100:",
      history("NIFTY100", kind="spells")["current_symbol"].nunique())
print("unique companies ever in NIFTY500:",
      history("NIFTY500", kind="spells")["current_symbol"].nunique())

today100 = set(members("NIFTY100", "2026-11-30", symbols="current"))
then100 = set(members("NIFTY100", "2015-01-01", symbols="current"))
print("of today's Nifty 100, in the index on 2015-01-01:",
      len(today100 & then100), "of", len(today100))

Use the point-in-time index universe that existed on the day

That is the practical use of a point-in-time index universe. On any rebalance date, ask members() who was actually in the index that day, and rank only those names. The list will not be today’s list, and that is the point.

Python Elite membership

MEMBERSHIP

Python Elite membership

15 Python, AI and algo trading programs in one plan, including QuantFlow and AI Bootcamp live mentorship.

  • Python from fundamentals to trading apps
  • Backtesting, broker APIs and OpenAlgo
  • Live QuantFlow and AI Bootcamp sessions
View Python Elite →by Marketcalls

Learn by watching: free videos every week

Market Profile, order flow, Python, AI and OpenAlgo tutorials on YouTube.

Rajandran R Creator of OpenAlgo Sketchmaker, RagZ. Building GenAI Applications. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Now the recent curiosity on building Trading AI Agents.

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More