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 my 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 at ingestion (
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.
Trend by speed (2026-10-15)
The 24 votes split into thirds by horizon (compute/trend_speeds.py, momentum_v3_spec.md): fast (21 and 42 sessions), medium (63, 126) and slow (189, 252), each the share of its 8 votes that are up, 0 to 100. The three average to the trend score; nothing new is computed from prices. A market’s speeds disagree when the fast and slow thirds point opposite ways by a majority (one at 62.5 or above, 5 of 8 up, and the other at 37.5 or below): “short-term dip in a longer uptrend” or “short-term bounce in a longer downtrend”. Shown on /trend/ (chapter “Fast against slow”, and fast/slow columns in the table view) and on each market’s trend tab (today’s thirds and a two-year weekly chart). Descriptive: tested as long-or-cash rules on 79 markets (SP-H1 to SP-H5), no speed beat another or buying and holding by more than luck, and after tax every speed trailed holding by about three points a year.
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), trend_models_v2_spec.md (the second review, 2026-10-13: volatility forecasts and scaling, the 52-week high, slow and fast blends, variance ratios, Markov switching and what followed past trends; none passed), momentum_v3_spec.md (the third review, 2026-10-15: trend by speed, SP-H1 to SP-H5, none passed; stock momentum MO-H6 to MO-H9), 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.
The trend tab (2026-10-13)
Each market page (/trend/<slug>/) is now the “Trend and momentum” tab of the market. For NSE indices it sits beside /indices/<slug>/ under a shared tab bar, so falls, calendar returns, valuation and holdings live on the index tab only. Gold, G-secs, the rupee and the overseas indices have no index tab and keep their falls chart and monthly calendar here. Brief: docs/briefs/trend_tab_and_models.md (stage 1). Code: compute/trend_tab.py, called from compute/trend_section.py; tests: pipeline/tests/test_trend_tab.py. Everything below is a description of the past built from the measures above; nothing is a new signal and none of it was tested.
- Today’s 24 votes: the four signal types by the six horizons (1, 2, 3, 6, 9 and 12 months = 21 to 252 sessions), each up or down, with counts by row and column. Blank until every window fills.
- Against its peers: each week, the market’s position in its family by the momentum rank (1 = strongest), among the family’s live markets that have a rank that week. The chart shows it as a 0–100 place (100 first, 0 last) over the last three years; the table ranks today’s family with each member’s place 13 weeks earlier. Families are the section’s own (broad, sectors, themes, strategies, other assets).
- What followed each trend: for every uptrend and downtrend (the 30/70 weekly regime), the market’s return from the close of the week it began to the close of the week it ended (or today), and over the next 63, 126 and 252 sessions from the week it began. Total return for NSE indices and the G-sec index, price otherwise. Forward windows that have not elapsed are left blank, never filled. Base rate: the same forward returns from every weekly reading with a full window. The page shows medians and the share positive for each, and says when fewer than 10 trends of either kind have a full year after them. Caveats on the page: trends overlap with each other’s next twelve months, a trend is called only after the move that defines it, and runs in back-calculated history are flagged.
- What the rules did, in rupees: ₹1 lakh in each rule and in buying and holding over the common window, before and after tax (the same engine and assumptions as the replays above; the final after-tax wealth is taken straight from
aftertax.after_tax_wealth, not rebuilt from a rounded CAGR). For each rule and for holding: the deepest fall with its peak and trough dates, and the worst three years against holding: the lowest value, over every 756-session window, of the rule’s annualised return minus holding’s over the same window, with its dates. - Models that hold it: every model on the board (
models_meta.json,board) whose registered universe includes the market’s lab asset (NSE indices by their total-return key; gold asgold/gold_long, the G-sec index asgsec5, the S&P 500 and Nasdaq-100 in rupees asspx_inr/ivv_inrandndx_inr). Weight today is the weight on the model’s latest recorded date. “Since” is the start of the current unbroken run of recorded dates (month-ends plus the latest decision) with a positive weight; dates before the model’s entry date come from its replay and the page says so. “Share of record” is the share of recorded dates with a positive weight. - After big moves (added 2026-10-13, pre-registered as TM-H7 in
trend_models_v2_spec.md): on each market’s daily level, five kinds of move: a close below the 200-day average after 20 sessions at or above it; the reverse; the first close 10% or 20% below the running high (counted again only after a new high); a 52-week high after 63 sessions without one. For each, the return over the next 21, 63, 126 and 252 sessions and the deepest fall within the next 252 (lowest later close against the move’s close), beside the same measures from every session. The trend tab shows per-market medians, the share higher a year later and every move; a small-sample note appears when a kind of move has happened fewer than ten times, and moves in back-calculated history are flagged. Code:compute/trend_tab.py(price_events,forward_outcomes,event_table). The pooled test across markets found nothing that survives the correction for ten comparisons; its two nearest results are quoted on the page.