The barometers: fear and greed, bull and bear, trend and momentum
How the four barometer pages are computed. The rules, hypotheses and pass bars were pre-registered before any result was computed: docs/research/market_mood_spec.md, trend_barometer_spec.md and momentum_barometer_spec.md, each with its results log. Code: pipeline/tipsheet/compute/barometers_{stats,mood,trend,momentum}.py, published by publish/barometers.py as barometers/*, refreshed by the plug-in step quant_barometers.
Shared rules
- Percentiles use expanding windows only. A reading’s percentile on a day is its rank among all its own values up to and including that day (ties count half). It is defined only after 756 sessions (36 months) of its own history.
- Publication lags. A value is used only from the first session it was public. Exchange data counts on its own date. AMFI monthly flows count 15 days after the month ends. IPO heat counts once the month is complete. The US VIX counts on the next Indian session.
- No fitted weights. Every composite is an equal-weighted mean.
- Risk-test baseline (B0): log realised volatility of the Nifty 500 over 5, 21 and 63 sessions, the log US VIX, and whether the Nifty 500 is below its 200-session average. A score must add to all of these to count as a risk forecast.
- “What happened next”: Nifty 500 total returns after every session in a band. “Separate spells” counts windows that do not overlap, taken greedily.
- Licence: only scores, percentiles, returns, ratios and rebased curves are published. No index levels, no prices, no VIX levels.
Fear and greed (/fear-and-greed/)
Six parts of the tape, 0 to 100. Each part is listed below with its start date.
- Nifty 500 against its 125-session average (1995).
- 52-week highs minus lows as a share of the liquid NSE universe (2004).
- The share of that universe above its 50-day average (2004).
- 20-session volatility over 252-session volatility, reversed (1995).
- Nifty 500 minus the 5-year G-sec index over 20 sessions (2001).
- Smallcap 250 minus Nifty 100 over 20 sessions (2005).
The reading is published when at least four parts are defined, which happens from 2007. It is tested where all six exist, from 2008. Bands follow CNN’s: 0–25, 25–45, 45–55, 55–75 and 75–100.
Bull and bear (/bull-bear/)
Five measures of positioning and flows, 0 to 10:
- equity fund net inflows over three months against assets (AMFI via IDH);
- foreign investors’ long share of index futures (NSE participant OI);
- the six-month change in the MTF book against market value (from June 2017);
- IPO heat;
- the share of NSE indices above their 200-day average (counted only when 20 or more indices qualify).
The reading needs at least three of the five parts, which happens from 2015. The zones are the top and bottom tenth of the score’s own history to date. Bank of America’s fixed 2 and 8 lines are shown for reference.
Trend barometer (/trend-barometer/)
Each asset gets 24 votes on its excess return over cash. There are four signal types: past return, price against its average, an average crossover (a quarter-length average against a full-length one), and position in the channel. Each is checked at 21, 42, 63, 126, 189 and 252 sessions. The score is the share of votes that are up.
- Assets: the rupee uses ECB reference rates (dollars per rupee). Sectors are NSE’s sectoral indices that are still published. Thematic and strategy indices are shown for description; the environment reading uses sectors only.
- Trend environment: the mean of |2 × score − 100| across the Nifty 500, gold, the G-sec index, the rupee and the median sector.
- Backtests: signals are taken at a close and acted on at the next close. Costs are 0.10% each way plus fund costs. Results are before tax.
- Timing luck: every rule is checked once every 21 sessions, on each of the 21 possible offsets.
- Execution lag:
trend.backtest(from the earlier models) trades at the signal’s own close. The barometer lags exposure one more session to match its spec.
Momentum barometer (/momentum-barometer/)
The universe is the point-in-time liquid NSE main-board universe of compute/breadth.py, taken at each month-end, with at least 273 sessions of history. It is survivorship-free. Prices are adjusted closes and do not include dividends.
- Six flavours: 12-1 and 6-1 returns; 12-1 divided by 252-session volatility; residual momentum (a market model fitted over 36 months, residuals over the 11 months of 12-1, scaled by their spread); the close against the 52-week high; and NSE’s normalised score (z of 12- and 6-month return over volatility, 50/50).
- Blend: each flavour is z-scored, capped at ±3, re-standardised and averaged; at least four flavours are needed.
- Portfolios: quintiles, equal-weighted, held one month. After a stock’s last trade it earns zero. The long-only version pays 0.25% each way.
- Crash flag: the Nifty 500 total return over 24 months is below zero (Daniel and Moskowitz’s bear-market indicator).
- Index momentum (
compute/barometers_indexmom.py, addendum 1 of the spec): the same six flavours on every live NSE index at completed month-ends, computed on total-return series. The 52-week high is the highest close, since these indices have no intraday high. Indices are ranked overall and within their family.- MO-H5 tests the blend on 13 non-overlapping sector indices: hold the top three each month against all 13 equally weighted, with costs as the trend rules. It failed.
- Individual stocks are not listed (indices-only scope); the stock panel only measures momentum.
- Nifty200 Momentum 30 replica: built on NSE’s rules (methodology document, September 2026, section 17). Scores use 12- and 6-month returns over volatility, with z-scores, a 50/50 weighted z and the normalised score. It holds the top 30 with NSE’s buffer (top 15 in, members beyond rank 45 out) and a 5% cap. Formation uses data to the end of the month before each rebalance month, and the change takes effect at the rebalance month’s last close.
- What it cannot copy: membership of the Nifty 200 is proxied by the 200 most-traded stocks over 126 sessions, there are no free-float weights, F&O eligibility is not applied, and returns are price returns.
- Validation: monthly returns on NSE’s June/December calendar correlate 0.91 with the real index. Its level trails the index.
- What it shows: the six semi-annual calendars are compared with each other. The tranched version averages them.
Checks
- Unit tests in
pipeline/tests/test_barometers.pycover the expanding percentile (no look-ahead), forward targets, the vote grid, episode counting, the NSE normalised score and the 5% cap. - The latest month-end is usually a partial month, so returns ending there are left out of every momentum test.