Data to 20 November 2026
About

Methods

Adjusted stock prices

Code: pipeline/tipsheet/compute/prices.py and compute/prices_qa.py.

Output: .cache/derived/equity_prices_adjusted.parquet (about 11.2 million rows: 5,535 companies, 7,934 sessions, 1994-11-03 to date).

This panel is not published directly. It is the input to stock breadth.

Sources

Method

  1. Stitch the eras. Where two series overlap, a fixed series priority decides which one is used (EQ first, then BE and the others).

  2. Turn each corporate action into a price factor. Splits, bonuses, consolidations, rights (at the theoretical ex-rights price) and demergers (from the price gap).

  3. Gate every factor on the price itself. A factor is applied only if the ex-date opening gap agrees with it within ×1.25.

    • stocks.events sometimes dates the ex-date a session early or late, so a rejected factor is re-tested on the next seven calendar days.
    • Factors that still fail are rejected and listed for review. These are mostly preference-share “bonuses”, such as TVS Motor’s 2025 4:1, where the price did not move.
  4. Read every exchange’s record. stocks.events keeps one row per action, tagged with the exchanges that reported it. Rows tagged only BSE count too, because a split applies to the company on both exchanges, but they are matched by ISIN only, never by symbol. Until 27 October 2026 only NSE-tagged rows were read, which dropped ITC’s 2005 bonus, KRBL’s 2010 split and Ambuja’s 2005 bonus, among others.

  5. Look for a missing companion. Companies often split and issue bonus shares on the same day, and the source tends to record only one of the two. When a recorded split or bonus fails the price gate, and the leftover gap is within 10% of a single split or bonus, both are applied. ITC’s 2005 1:2 bonus came with a split from ₹10 to ₹1, so the combined factor is 1/15. 28 actions are adjusted this way, flagged with_companion.

  6. Infer actions the publisher missed. A split, bonus or consolidation is inferred from the price only when all of these hold:

    • the prior close is at least ₹10 and the previous trade at most seven days earlier
    • the close is at most 55% of the prior close (or at least 180%), and the open at most 75% (at least 133%). With price bands of 20% or less, a crash opens near the prior close and falls during the day: Satyam in 2009 and Yes Bank in 2020 opened 0–10% down. A split shows up in the opening price.
    • the new level holds for five sessions (within 25%, or 50% when the open itself gapped past 55%)

    The factor is the nearest single split or bonus (within 4% of the close, failing that the open; 10% for ratios of ¼ or less). Failing that, it is the nearest split-and-bonus pair within 6%, and failing that the close-to-close ratio, flagged inferred_from_gap. The close is tried first because opening prices on split days are often off: ETF splits regularly open 20% away from the new level.

    Ratios of 0.6–0.75 are never inferred, because a 25–40% fall can be real. They go to a review list instead.

  7. Demergers without a ratio use the opening gap, unless the stock then fell another 20% or more in the session. Then the open was held up by the price band and the ex-day close is used instead. Adani Enterprises in 2015 opened 10% down and closed 83% down.

  8. Clean zero prices. Zero open, high or low prices are treated as not reported. 1990s files print 0 when only a close was traded.

What I checked

Lifetime returns

Code: compute/lifetime_returns.py, step lifetime_returns. Bundles: markets/lifetime/buckets, markets/lifetime/cohorts. Page: /markets/#lifetime.

Review lists

These are written to .cache/derived/ on every run:

FileWhat it holds
qa_price_jumps.csvOne-day moves too large to be ordinary trading
qa_candidate_bonus.csvPossible bonuses that were not inferred
qa_rejected_actions.csvPublisher factors that failed the price gate
qa_missing_sessions.csvSessions that appear to be missing

Known limits

This note is the repository file docs/methods/prices.md, rendered as-is.