Skip to content
Skip to Content
DalalOSdocs

Recipe

Index change study

Look at changes in an index's membership and how the stocks traded around them. What you may do with the data is set by the terms.

What you will build

A table of index membership changes, with the trading around each date and the money tracking the index that the change implies.

Before you start

  • An API key on a plan that includes the REST API. Create one on the keys page of your dashboard and set it as DALALOS_API_KEY.
  • Credits: each call costs credits from your plan. The limits say how many calls a run makes. Plans and credits are on Plans, credits and errors.
  • An index name from GET /indices.
  • A company, for the money-flow step.

Step 1: List indices

List the indices whose members are held. Each entry in indices has an index name and a member count. Use a name from this list in the next calls.

GET /indices has the parameters, the errors and a box to send the call.

List indices
curl -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/indices"
{
  "status": "success",
  "data": {
    "count": 36,
    "indices": [
      {
        "index": "BSE 100",
        "count": 70,
        "membership_metadata": {
          "publication_state": "legacy_untracked",
          "expected_member_count": null,
          "published_member_count": null,
          "published_at": null,
          "last_source_attempt_at": null,
          "last_source_attempt_status": null,
          "last_source_member_count": null,
          "last_source_resolved_member_count": null,
          "last_source_unresolved_member_count": null,
          "last_source_error": null
        }
      },
      {
        "index": "BSE 1000",
        "count": 503,
        "membership_metadata": {
          "publication_state": "legacy_untracked",
          "expected_member_count": null,
          "published_member_count": null,
          "published_at": null,
          "last_source_attempt_at": null,
          "last_source_attempt_status": null,
          "last_source_member_count": null,
          "last_source_resolved_member_count": null,
          "last_source_unresolved_member_count": null,
          "last_source_error": null
        }
      }
    ]
  },
  "cached_at": null,
  "source": "bse-comheader+niftyindices",
  "stale": false,
  "error": null,
  "reason_code": null
}

Saved answer. Run on 2026-11-27, answered 200. Lists show their first item in full; the other items and long text are shortened. A call you make now gets the current answer.

Feeds the next step: The index name.

Step 2: Index membership changes

List membership changes. Give an index, a company or a date range: at least one of them is required. Each entry in events has a change_type, an announced_date, an effective_date and the company; truncated says the list was cut.

GET /index-events has the parameters, the errors and a box to send the call.

Index membership changes
curl -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/index-events?index=NIFTY+50&from=2025-01-01"
{
  "status": "success",
  "data": {
    "filters": {
      "index": "NIFTY 50",
      "from_date": "2025-01-01",
      "include_superseded": false
    },
    "count": 16,
    "truncated": false,
    "events": [
      {
        "event_id": 19308,
        "index_id": "nse:nifty_50",
        "index": "NIFTY 50",
        "provider": "nse",
        "company": {
          "isin": "INE118H01025",
          "nse_symbol": "BSE",
          "name": "BSE Limited",
          "printed_name": "BSE Ltd.",
          "resolved": true
        },
        "change_type": "add",
        "announced_date": "2026-08-10",
        "effective_date": "2026-09-30",
        "effective_basis": "close_of_previous",
        "status": "effective",
        "pending": false,
        "captured_by": "parsed_document",
        "document_url": "https://niftyindices.com/Press_Release/ind_prs10082026.pdf"
      },
      {
        "event_id": 19307,
        "index_id": "nse:nifty_50",
        "index": "NIFTY 50",
        "provider": "nse",
        "company": {
          "isin": "INE075A01022",
          "nse_symbol": "WIPRO",
          "name": "Wipro Limited",
          "printed_name": "Wipro Ltd.",
          "resolved": true
        },
        "change_type": "delete",
        "announced_date": "2026-08-10",
        "effective_date": "2026-09-30",
        "effective_basis": "close_of_previous",
        "status": "effective",
        "pending": false,
        "captured_by": "parsed_document",
        "document_url": "https://niftyindices.com/Press_Release/ind_prs10082026.pdf"
      }
    ],
    "indices": [
      {
        "index_id": "nse:nifty_50",
        "display_name": "NIFTY 50",
        "provider": "nse",
        "history_start": "2021-07-01"
      }
    ],
    "latest_trading_date": "2026-11-27",
    "history_start": "2021-07-01",
    "notes": [
      "effective_date is the first trading day the change applies; when the source names another day (MSCI's 'as of the close of' a date gives the calendar day afte…"
    ]
  },
  "cached_at": "2026-11-19T21:35:24+00:00",
  "source": "indian-stock-mcp-index-events",
  "stale": false,
  "error": null,
  "reason_code": null,
  "data_age_seconds": 667331.549,
  "as_of": "2026-11-27"
}

Saved answer. Run on 2026-11-27, answered 200. The data in it was collected on 2026-11-19, not on the run date. Lists show their first item in full; the other items and long text are shortened. A call you make now gets the current answer.

Step 3: How stocks traded around index changes

Read the returns before, around and after the dates of the changes. The index is required. counts says how many events were found and analysed, and statistics holds the figures. The study needs at least five events before it gives statistics.

GET /index-events/study has the parameters, the errors and a box to send the call.

How stocks traded around index changes
curl -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/index-events/study?index=NIFTY+50&change_type=add&limit=20"
{
  "status": "success",
  "data": {
    "filters": {
      "index_id": "nse:nifty_50",
      "change_type": "add",
      "include_flagged": true
    },
    "index": {
      "index_id": "nse:nifty_50",
      "display_name": "NIFTY 50",
      "provider": "nse",
      "history_start": "2021-07-01"
    },
    "latest_trading_date": "2026-11-27",
    "counts": {
      "events_found": 15,
      "analysed": 11,
      "pending": 0,
      "not_analysed": 4,
      "excluded_as_flagged": 0
    },
    "not_analysed_reasons": {
      "no_trading_before_event": {
        "count": 4,
        "meaning": "the security's NSE listing date is on or after the effective date, so no NSE price exists before it"
      }
    },
    "statistics": {
      "after_20.benchmark_return_pct": {
        "n": 11,
        "n_incomplete_excluded": 0,
        "n_missing": 0,
        "n_pending": 0,
        "median": 2.91,
        "p25": -0.74,
        "…": "4 more keys"
      },
      "after_20.excess_return_pp": {
        "n": 11,
        "n_incomplete_excluded": 0,
        "n_missing": 0,
        "n_pending": 0,
        "median": 0.8,
        "p25": -1.58,
        "…": "4 more keys"
      },
      "after_20.stock_return_pct": {
        "n": 11,
        "n_incomplete_excluded": 0,
        "n_missing": 0,
        "n_pending": 0,
        "median": 4.44,
        "p25": -3.51,
        "…": "4 more keys"
      },
      "after_60.benchmark_return_pct": {
        "n": 10,
        "n_incomplete_excluded": 1,
        "n_missing": 0,
        "n_pending": 0,
        "median": 4.58,
        "p25": -5.58,
        "…": "4 more keys"
      },
      "after_60.excess_return_pp": {
        "n": 10,
        "n_incomplete_excluded": 1,
        "n_missing": 0,
        "n_pending": 0,
        "median": 4.1,
        "p25": -6.33,
        "…": "4 more keys"
      },
      "after_60.stock_return_pct": {
        "n": 10,
        "n_incomplete_excluded": 1,
        "n_missing": 0,
        "n_pending": 0,
        "median": 4.35,
        "p25": -8.22,
        "…": "4 more keys"
      },
      "…": "22 more keys"
    },
    "small_sample": true,
    "events": [
      {
        "event_id": 19308,
        "company": {
          "isin": "INE118H01025",
          "nse_symbol": "BSE",
          "name": "BSE Limited",
          "printed_name": "BSE Ltd.",
          "resolved": true
        },
        "announced_date": "2026-08-10",
        "effective_date": "2026-09-30",
        "reaction_session": "2026-08-10",
        "effective_session": "2026-09-29",
        "pending": false,
        "figures_source": "stored",
        "flagged": true,
        "flags": [
          "bulk_block_deal_nearby",
          "price_band_hit_nearby",
          "other_index_event_nearby"
        ],
        "windows": {
          "run_up": {
            "stock_return_pct": -9.3,
            "excess_return_pp": -10.86,
            "complete": true
          },
          "reaction": {
            "stock_return_pct": 4.02,
            "excess_return_pp": 3.89,
            "complete": true
          },
          "announce_to_effective": {
            "stock_return_pct": -7.44,
            "excess_return_pp": -0.64,
            "complete": true
          },
          "effective_day": {
            "stock_return_pct": 3.31,
            "excess_return_pp": 3.9,
            "complete": true
          },
          "after_20": {
            "stock_return_pct": 9.44,
            "excess_return_pp": 10.16,
            "complete": true
          },
          "after_60": {
            "stock_return_pct": 24.7,
            "excess_return_pp": 15.72,
            "complete": false
          }
        }
      }
    ],
    "not_analysed_events": [
      {
        "event_id": 16859,
        "company": {
          "isin": "INE2KCE01013",
          "nse_symbol": "KWIL",
          "name": "Kwality Wall's (India) Limited",
          "printed_name": "Kwality Wall's (India) Ltd.",
          "resolved": true
        },
        "effective_date": "2025-12-05",
        "reason": "no_trading_before_event",
        "reason_text": "the security's NSE listing date is on or after the effective date, so no NSE price exists before it"
      }
    ],
    "data_through": "2026-11-26",
    "benchmark": "Nifty 500",
    "definitions": {
      "reaction_day": "A: the first session in which the market could trade on the announcement. An announcement after the Indian close counts from the next session.",
      "effective_session": "E: the last session before the change applies, the session in which funds tracking the index trade.",
      "windows": {
        "run_up": "A-20 to A-1",
        "reaction": "A",
        "announce_to_effective": "A to E",
        "effective_day": "E",
        "after_20": "E+1 to E+20",
        "after_60": "E+1 to E+60",
        "announce_to_latest": "A to the latest session held; present only while E is ahead"
      },
      "baseline": "Median daily volume, traded value and delivery over A-80 to A-21 (E-80 to E-21 when there is no A).",
      "returns": "Price returns without dividends. The stock return compounds each day's close over previous close, so splits and bonuses do not break it. excess_return_pp is …",
      "incomplete_window": "A window that runs past the data or lacks a stock bar on some session has complete=false and covers only the sessions that exist; group statistics leave it out.",
      "…": "3 more keys"
    },
    "notes": [
      "statistics give, for each figure, the count, median, 25th and 75th percentile, minimum, maximum and the share of events above zero (a fraction); figures from…"
    ]
  },
  "cached_at": "2026-11-26T20:10:31+00:00",
  "source": "indian-stock-mcp-index-events",
  "stale": false,
  "error": null,
  "reason_code": null,
  "data_age_seconds": 71121.445,
  "as_of": "2026-11-26"
}

Saved answer. Run on 2026-11-27, answered 200. Lists show their first item in full; the other items and long text are shortened. A call you make now gets the current answer.

Step 4: Estimated money implied by an index change

Read the arithmetic of the money that tracks an index and what a company's weight implies. The company and the index are required. published has the weight (weight_pct) as the index provider states it, and inputs the figures behind the arithmetic.

GET /index-events/flow has the parameters, the errors and a box to send the call.

Estimated money implied by an index change
curl -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/index-events/flow?query=RELIANCE&index=NIFTY+50"
{
  "status": "success",
  "data": {
    "company": {
      "isin": "INE002A01018",
      "nse_symbol": "RELIANCE",
      "name": "Reliance Industries Limited"
    },
    "index": {
      "index_id": "nse:nifty_50",
      "display_name": "NIFTY 50",
      "provider": "nse",
      "history_start": "2021-07-01",
      "weighting": "float_cap"
    },
    "latest_trading_date": "2026-11-27",
    "published": {
      "weight_pct": 7.3,
      "index_market_cap_cr": 776773.78,
      "as_of_month": "2026-10",
      "source": "index_weights (NSE monthly weights file)"
    },
    "inputs": {
      "market_cap": {
        "value_rs": 18894130563700,
        "as_of": "2026-11-26",
        "source": "cm_market_cap_daily (NSE's daily market cap, rupees)"
      },
      "promoter_holding": {
        "pct": 50.44,
        "as_of": "2026-09-30",
        "source": "shareholding"
      },
      "market_cap_on_published_month_end": {
        "value_rs": 15764054357300,
        "as_of": "2026-10-30",
        "source": "cm_market_cap_daily (NSE's daily market cap, rupees)"
      },
      "weight_rule": {
        "rule": "published_weight",
        "label": "exact",
        "text": "The weight NSE publishes in its monthly index weights file; exact."
      },
      "index_total_float_adjusted": {
        "value_rs": 106383415700000,
        "basis": "sum of the published index market cap of every constituent",
        "as_of_month": "2026-10",
        "constituents": 50,
        "source": "index_weights (NSE monthly weights file)"
      },
      "stock_is_current_member": true,
      "tracking_assets": {
        "supplied_by": "cache",
        "measure": "passive_assets",
        "amount": 4985760000000,
        "currency": "INR",
        "as_of": "2026-05-31",
        "document_url": "https://niftyindices.com/Nifty_Passive_Insights/NiftyPassiveFundReport-June2026.pdf",
        "source_kind": "primary",
        "note": "Sums 21 ETF(s) = Rs 398,376 crore and 26 index fund(s) = Rs 100,200 crore; equity-oriented schemes only, per NSE Indices annexure.",
        "other_measures_on_that_date": [
          {
            "measure": "etf_assets",
            "amount": 3983760000000,
            "currency": "INR"
          }
        ],
        "amount_rs": 4985760000000
      },
      "median_daily_traded_value": {
        "value_rs": 17441997550.7,
        "sessions_with_data": 60,
        "window_sessions": 60,
        "newest_session": "2026-11-27",
        "source": "price_history (turnover, rupees)"
      }
    },
    "estimates": {
      "estimated_float_factor": 0.492750000981,
      "estimated_free_float_market_cap_rs": 7767737800000,
      "estimated_weight_pct": 7.3,
      "estimated_demand_rs": 363960480000,
      "estimated_demand_pct_of_free_float": 4.68554023541,
      "estimated_days_of_median_traded_value": 20.866903515
    },
    "not_computed": [],
    "notes": [
      "MSCI and FTSE apply their own float and foreign inclusion rules, which are not held per stock here. This estimate removes only promoter holdings (and, for MS…",
      "The stock is already a member of this index as held, so the figures describe the money tracking its existing weight, not a purchase."
    ]
  },
  "cached_at": null,
  "source": "indian-stock-mcp-index-events",
  "stale": false,
  "error": null,
  "reason_code": null,
  "as_of": "2026-11-26"
}

Saved answer. Run on 2026-11-27, answered 200. Lists show their first item in full; the other items and long text are shortened. A call you make now gets the current answer.

The full script

Python 3 with the requests package. It reads your key from DALALOS_API_KEY, waits once when the API asks it to slow down, stops with a plain message on 401, 402 and 403, and prints what it reads.

index_change_study.py
import json
import os
import sys
import time

import requests

BASE = "https://mcp.dalalos.in/v1"
HEADERS = {"Authorization": "Bearer " + os.environ["DALALOS_API_KEY"]}


def call(method, path, **kwargs):
    """One request. Waits once on a 429. Stops with a plain message on 401, 402 and 403."""
    for attempt in range(2):
        response = requests.request(method, BASE + path, headers=HEADERS, timeout=30, **kwargs)
        if response.status_code == 429 and attempt == 0:
            time.sleep(float(response.headers.get("Retry-After", "2")))
            continue
        break
    if response.status_code == 401:
        sys.exit("401: the key is missing or not valid. Create one at https://dalalos.in/dashboard/keys")
    if response.status_code == 402:
        sys.exit("402: the monthly credits are used up.")
    if response.status_code == 403:
        sys.exit("403: this plan does not include the REST API.")
    response.raise_for_status()
    return response.json()


def show(title, answer, limit=1200):
    print("==", title)
    print(json.dumps(answer, indent=2)[:limit])


INDEX = "NIFTY 50"  # a name from GET /indices
COMPANY = "RELIANCE"

indices = call("GET", "/indices")["data"]["indices"]
print("indices with members:", [i["index"] for i in indices][:10], "...")

events = call("GET", "/index-events", params={"index": INDEX})["data"]
print(len(events["events"]), "membership changes" + (" (cut: narrow the dates)" if events["truncated"] else ""))
for event in events["events"][:5]:
    print(" ", event["change_type"], "announced", event["announced_date"], "effective", event["effective_date"])

study = call("GET", "/index-events/study", params={"index": INDEX, "change_type": "add", "limit": 20})["data"]
print("events found:", study["counts"]["events_found"], "analysed:", study["counts"]["analysed"])
show("returns around the changes", study["statistics"], limit=1200)

flow = call("GET", "/index-events/flow", params={"query": COMPANY, "index": INDEX})["data"]
print(COMPANY, "published weight in", INDEX, ":", flow["published"]["weight_pct"], "%")

Limits

  • A run makes four calls, each charged in credits from your plan.
  • Membership history starts at a date set per index: /index-events/flow gives it as history_start (2021-07-01 for NIFTY 50 in the saved answer).
  • Index names are matched without regard to case. The list of indices with members and the list of indices with valuations are not the same list.
  • The study gives no statistics for fewer than five events.

Extend it

  • Add GET /indices/{index}/constituents to see the members now.
  • Add GET /index-valuations/{index} to read the valuation history of the same index.
  • More routes: Indices.

KEEP EXPLORING