Index returns and highs and lows
Code: pipeline/tipsheet/compute/indices.py, compute/tri_check.py, publish/indices.py.
Bundles: markets/indices/*.
Data
- NSE total-return indices (
nifty_index_total_returns) and price indices (nifty_index_history), joined by NSE index code.- We tried joining by name first, and it silently matched almost nothing.
- Groups follow NSE’s own classification: 19 broad, 23 sectoral, 43 thematic and 34 strategy indices.
- Display names are normalised, so “NIFTY Midcap 100” becomes “Nifty Midcap 100”.
Bad total-return prints
Some NSE total-return series contain bad prints. tri_check.py finds them by comparing each total-return index with its price index:
-
What counts as bad:
- The log of TRI/price moves by more than 1% and reverts within 5 sessions.
- Or it steps down permanently.
On those days the price-index return is used instead.
-
What is kept: permanent upward steps are real large dividends, such as Coal India’s March payouts in CPSE and Metal, and REIT distributions.
-
What it found: of 125 indices checked, only Nifty Smallcap 100 had bad prints. That was 11 days in 2005–2009, such as −17% then +33% on 2009-05-20 to 05-22, while the price index rose 8%, 2% and 3%.
Every module that reads total-return indices applies this repair.
Calendar-year returns with intra-year drawdown
- Return: the calendar-year total return.
- Intra-year drawdown: the worst fall from a running peak within the year, with the prior year-end as the first peak. This is J.P. Morgan’s convention.
- Checks on Nifty 50:
- 2008: −51.3% for the year, worst fall −59.5%
- 2009: +77.6%
- 2020: worst fall −38.3%
Monthly returns
Total return for each calendar month, per index.
Index highs and lows
- Measure: the share of indices in each group that set a 52-week high (or low) at least once in the last 21 sessions, plus the net of the two.
- Why a window: a single-day count was unreadable noise.
- Start date: 2004-12.