Asset panel, trend, momentum and the portfolio lab
Code:
pipeline/tipsheet/compute/assets.pytrend.py,momentum.pyportfolio_lab.py,aftertax.pypublish/models.py,publish/lab.py
Bundles: models/* and lab/*.
Rules and results: the rules are pre-registered, so results can’t be fitted after the fact:
docs/research/trend_momentum_spec.mddocs/research/portfolio_lab_spec.md
Each spec logs its results, including the null ones.
The asset panel
Daily growth-of-₹1 series for each asset class:
| Asset | Source | Notes |
|---|---|---|
| Equity | NSE total-return indices: Nifty 50, Next 50, 100, 500, Midcap 150, Smallcap 250 and others | Bad prints repaired (see indices.md) |
| Gold | World Gold Council INR price, from 2005 | The domestic price including import duty, which is what Indian gold ETFs track. Before 2005, it is ratio-linked to the USD price × USD/INR. The duty premium is 1–2% before 2012, 8–15% after the 2012–13 hikes and about 5% after the 2024 cut |
| G-sec | NSE 5-year benchmark G-sec index (total return), from 2001 | A 5-year bond, not a broad bond index |
| Cash | Accrues the 91-day T-bill yield, using only yields already published | 2012–2025 CAGR 6.66%, against 6.26% for NSE’s 1-day rate index |
Backtest rules common to all models
-
No look-ahead. Signals use the close of day t, and trades happen at the close of day t+1, so the position first earns the return from close t+1 to close t+2. Until 2026-10-03 the code traded at the signal’s own close; see the audit correction in
trend_momentum_spec.md. -
Monthly rules use completed month-ends only. A close early in a new month is not a month-end.
-
Calendar time: CAGR and running costs use calendar days; NSE has about 249 sessions a year, not 252. Volatility and Sharpe are annualised with √252 by convention.
-
Trading cost: 0.10% of value traded, each way.
-
Annual running costs while invested:
Equity Gold G-sec Cash 0.15% 0.50% 0.20% 0.20% -
Multiple testing: the deflated Sharpe ratio (Bailey and López de Prado, 2014), counting every trial honestly.
-
Periods reported: full sample, each half, and 2012 onward.
After-tax results (aftertax.py)
- Tax engine: since 2026-10-03, the lab’s (
lab/tax.py, rules in Appendix B ofportfolio_lab_v2_spec.md). - Lots: matched first in, first out. Each gain is classified by sale date and holding period:
- Equity: STCG at the slab, 10%, 15% and then 20%; LTCG at the lower of 10% plain and 20% indexed before October 2004, then exempt, then 10% and then 12.5%. January 2018 prices are grandfathered.
- Debt and liquid funds: indexation before April 2023; slab rate for units bought from April 2023 (section 50AA); 12.5% after 24 months for older units sold from 2024-07-23.
- Gold ETFs: section 50AA until 2025-04-01; 12.5% after 12 months.
- Cess: as in force.
- Settlement: losses are set off within each financial year and carried forward for eight years. Each year’s tax is settled at the year’s last session and paid the next session by selling both legs pro rata.
- Simplifications: everything is sold at the end; the investor is in the 30% slab with no surcharge; the annual equity exemption is ignored.
Headline results
These were logged on 2026-10-01 and corrected by the audit on 2026-10-03 (data to 1 Oct 2026).
Trend rules:
- They cut the Nifty 50’s worst fall from −59.5% to between −26% and −44%.
- None is significant after deflation.
- After tax, they trail buy-and-hold on every large-cap index, by 1.1–5.2 points a year (1.9–6.1 before the audit corrected the timing and the tax engine).
- The 200-day rule’s pre-tax edge on mid and small caps is 1.2 and 2.1 points a year (deflated values 0.10 and 0.14).
Sector momentum: not significant.
Portfolio lab (2002-10 to 2026-09):
- 60/20/20 beat 60/40 (16.4% vs 14.7% CAGR), and did so in 76% of rolling 5-year windows.
- The permanent and equal-three mixes had the best Sharpe (0.89).
- Tactical portfolios lost 1.6–2.8 points a year to tax.