Trend and momentum of every market
How the section at /trend/ measures trend, momentum and regimes for every Indian index, gold, G-secs, the rupee and overseas indices in rupees. These are descriptions of the past, not tested signals; the tests are on /trend/evidence/ and in the specs listed at the end.
Code: pipeline/tipsheet/compute/trend_taxonomy.py, compute/trend_section.py, publish/trend_section.py, refreshed by the plug-in step steps/trend_section.py. Tests: pipeline/tests/test_trend_section.py. Bundles: trend/*.
The markets
- Indian equity indices: every NSE broad, sector, theme and strategy index that printed in the last 10 days and has at least 252 sessions of history (114 on 1 Oct 2026). Total-return indices, with bad prints repaired against the price index (
indices.md). - Other assets: gold in rupees including import duty (World Gold Council; USD gold × USD/INR before 2005), the NSE 5-year G-sec index (total return), the rupee (US dollars per rupee, ECB reference rates, so up is a stronger rupee), and 11 overseas indices converted to rupees at ECB reference rates (as in
world.md). The overseas indices are price indices (the DAX is total return), so they miss one to four points a year of dividends against the Indian total-return indices. Their providers’ licences allow derived statistics only: they get scores, ranks, drawdowns and monthly returns, never a growth curve. - Families: broad market, sectors, themes, strategies and factors (NSE’s own groups), and other assets. One taxonomy (
trend/taxonomy) holds each market’s family, sub-group, source, first value, launch date and flags; the risk section reads the same table. - Not included: indices that stopped printing (e.g. Nifty India FPI 150) and indices with under a year of data in our feed. Today’s members only: the family histories use today’s live indices, counted from launch (below).
Launch dates and back-calculated history
NSE publishes most indices with a history that starts years before their launch: today’s rules applied to the past. Rules chosen with that past in view look better in it than they will afterwards.
- Source: launch dates from NSE’s factsheets, parsed by the Data bank (
data/parsed/nifty_index_factsheets) and frozen incompute/trend_launch_dates.csvwith the factsheet URL. - Unknown launches are not guessed. Six old indices (Nifty 500, Midcap 50, IT, MNC, PSE, Services Sector) parse with the factsheets’ report date as their launch; they are marked “launch date unknown” and drawn as published.
- Flag: an index is back-calculated when its launch is more than a month after its first value (105 of 114 on 1 Oct 2026). Charts mark the launch; regime strips draw the pre-launch part lighter.
- Family aggregates count each member only from its launch (or first value when the launch is unknown), and need five counted members. So the share of sectors in an uptrend in 2008 counts only the sectors NSE was publishing in 2008.
The trend score
The pre-registered score of trend_barometer_spec.md, unchanged: four signal types (past return, price against its average, a quarter-length average against a full-length one, position in the high-low channel) at six horizons (21, 42, 63, 126, 189 and 252 sessions), each a vote, on the market’s level divided by the 91-day T-bill cash index (so a market that only keeps pace with cash is not trending). The score is the share of the 24 votes that are up, 0 to 100. Pages show the votes at 1, 3, 6 and 12 months (21, 63, 126, 252 sessions), up to four each.
Uptrend and downtrend (the regime)
- On weekly readings (each week’s last session), a market enters an uptrend when its score reaches 70 (17 of 24 votes up) and stays in it until the score falls to 30 or below, when it enters a downtrend; and the reverse. Before the first crossing it has no regime. “Uptrend since March 2026” dates the week the regime began.
- Why a band, not a line: with a single threshold the weekly state flickered (median run two weeks; two thirds of runs under four weeks, across all 128 markets over five years). With 30/70 the median run is 11 weeks and 17% are under four. A 4-week average with 40/60 is steadier still but adds a second parameter and a lag. Evidence and alternatives:
docs/status/trend.md, Phase 0. - It is causal (each week uses only that week and earlier) and was chosen for readability, not for any forecasting result. It is not tested.
- How long regimes like this lasted: for each market, its completed uptrends (or downtrends) that had reached today’s length, and the share that went on at least 13 and 26 more weeks; the same pooled across the family, post-launch runs only. Runs within a family overlap in time, so these are counts of episodes, not independent trials.
Momentum rank
Each market’s return over cash at 1, 3, 6 and 12 months (21, 63, 126, 252 sessions) is ranked as a percentile among the markets with that horizon on that day; the four percentiles are averaged and the average ranked again, 0 to 100 (100 strongest). Shown overall and within the family. Daily, published weekly. It is relative: in a falling market the leaders may still be falling. The pre-registered six-flavour blend (momentum_barometer_spec.md, MO-H5) remains the tested version and is on the evidence page.
Rule states and replays
- States in words: the 10-month rule (month-end level above the average of the last 10 completed month-ends) and the 200-day rule (close above the 200-session average), from
compute/trend.py. “Holding since April 2026” or “in cash since September 2026”, dated by the decision. The words “In” and “Out” are not used. - Replays on the 116 investable markets (Indian indices, gold, G-secs): the two rules and the 24-signal ensemble (exposure = score ÷ 100), with
trend.backtest’s timing: decided at the close of day t, traded at the close of t+1. Costs: 0.10% of value traded each way; running costs of 0.15% a year for equity index funds, 0.50% for gold, 0.20% for G-secs and the cash leg. - Window: all three rules and buying and holding over the same dates, from when every rule has enough history; and, where it is three years or more, since the launch. On the seven pre-registered markets this reproduces
/trend/evidence/exactly when run from each rule’s own start (checked: Midcap 150 200-day rule 16.17% against 14.99%, after tax 14.64%). - After tax: the lab’s engine (
lab/tax.py): capital-gains rates by sale date and holding period, set-off and carry-forward, the 30% slab, sold at the end. Not computed for the ensemble, which trades a little every day. - These replays are not tests. The rules were registered on seven markets; across 116 more, some will favour the rules by chance, the markets overlap, and many histories are back-calculated.
Other measures on the market pages
- Drawdown: percentage below the running high of the total-return series (price for gold, the rupee and overseas indices), weekly.
- Monthly returns: the last session of each month to the last session of the next; the latest month is month to date.
- Valuation: NSE’s P/E and P/B at month-ends for the 22 indices whose valuations the site already reads (
valuation.md). NSE moved to consolidated earnings in 2021; the break is marked.
What is published
Scores, votes, ranks, returns, drawdowns and rebased growth curves for NSE indices, gold and G-secs. No index levels. The licence gate (publish/licence_gate.py) runs over every bundle.
Related specs
docs/research/trend_momentum_spec.md (single rules, sector momentum), trend_barometer_spec.md (the ensemble), momentum_barometer_spec.md (stock momentum, MO-H5), and the audit register docs/research/AUDIT.md (rows T1–T6, BT1, R1–R5, D9).
Path quality diagnostics (2026-10-05)
These additions do not change registered trend votes, momentum ranks, regime thresholds or strategy replays. Use native total-return index closes on the breadth market-session calendar, without filling missing prices. Missing, nonpositive or nonfinite closes interrupt full-window calculations. Publish weekly last-session readings and a latest common-session table. Histories start at known launch dates; unknown launches use reported history. Warmup may use provider pre-launch history, so early diagnostics can reflect back-calculations.
Fixed 63-session efficiency is absolute net displacement divided by the sum of absolute daily price changes, times 100. It needs 64 closes (63 changes). A flat zero-length path is blank. High efficiency can describe falls as well as rises; direction remains in the existing trend score.
Persistence is the fraction of the last 63 sessions strictly above their own trailing 200-session simple average. It needs valid averages at all 63 sessions (262 closes). Equality does not count as above.
Extension is log(close / 200-session average) divided by the trailing 63-session sample standard deviation of daily log returns times √63. Zero volatility is blank. This is a scaled distance, not a statistical z-score or reversal forecast. Annualised volatility uses the same standard deviation times √252, in per cent. Rank persistence and cross-measure redundancy analysis remain separate work; no composite score, outcome test or trading rule is inferred.
Representative quality displays
The four index family quality chapters lead with fixed editorial lists in
apps/site/src/lib/trend-display.ts. Broad benchmarks include Nifty 200 and
Nifty 500, followed by distinct size segments. Sector defaults retain main
business benchmarks, including both healthcare and pharma. Themes use a
cross-section of distinct concepts. Strategies show one representative for
main factor/construction approaches, preferring a Nifty 500 parent where
available. Remaining indices stay in grouped selectors and expanded tables.
These are display choices, without performance selection or changes to analytic
universes, family breadth, rankings, signals or histories. Index overlap and
construction differences remain explicit.