Sector-Neutral Quality 30
The Quality screen scored WITHIN each sector rather than across the whole market, so a bank competes against banks and an IT company against IT. Caps any one sector at 25% of the book. Quarterly.
Why this is expected to work
Accounting ratios are not comparable across sectors, and a screen that ignores this is mostly a sector bet wearing a factor label. Banks carry structurally high leverage because lending IS their business, so a debt-to-equity screen run across the whole market excludes the entire financial sector on an accounting artefact rather than a judgment about quality. Software firms carry structurally high return on equity because they hold little capital, so an ROE screen over-selects them. Scoring within sectors removes the level difference and asks the question that actually generalises: is this company good RELATIVE TO ITS PEERS. The sector cap does the complementary job on the output side. Even a sector-neutral score can concentrate if one sector happens to hold the best-ranked names, and NSE's factor indices cap exposure for exactly this reason. Concentration is the risk a factor screen adds silently, because nothing in the ranking logic notices it.
How the pipeline works
NIFTY500 constituent
Keeps rows where nifty500_member == 1
nifty500_member == 1 Liquid: traded > Rs 5 cr/day
Keeps rows where turnover > 50000000
turnover > 50000000 Sector classified
Keeps rows where sector > 0
sector > 0 Return on equity
Computes roe = net_profit_annual_consolidated / total_equity_annual_consolidated
net_profit_annual_consolidated / total_equity_annual_consolidated Debt to equity
Computes debt_to_equity = total_debt_annual_consolidated / total_equity_annual_consolidated
total_debt_annual_consolidated / total_equity_annual_consolidated Positive equity and profit
Keeps rows where roe > 0
roe > 0 Sector-neutral quality
Blends 2 factors into quality_score
Top 30 within sectors
Selects the top 30 by quality_score
NSE score transform
Sizes positions: Normalized score
Cap any sector at 25%
Caps any single position at 8%
What this template teaches
- group_by='sector' — scoring within peer groups
- ConstraintsRule.max_group_weight — a sector cap
- The `sector` field, read straight off the Security table
- Why cross-sector ratio comparisons mislead
Sector-Neutral Factors: Why Cross-Sector Ratio Screens Mislead
Banks carry high leverage because lending is their business. Software firms carry high ROE because they hold little capital. A screen that ignores this is mostly a sector bet wearing a factor label.
Related strategy templates
Find the right starting point for your next trading thesis.
Blank Canvas
An empty pipeline on the NSE equity universe with monthly rebalancing and equal weighting. Nothing is screened or ranked — start here when you want to build the whole thesis yourself.
View detailsLow Volatility 30
Holds the 30 calmest large- and mid-caps by realised annualised volatility, sized inversely to that volatility so the quietest names carry the most capital. The construction NSE uses for its Nifty100 Low Volatility 30 index, on the exchange's own published volatility series.
View detailsWatchlist: Select Monthly, Re-Risk Weekly
Two schedules on one canvas. Once a month it picks the eight strongest names from a fixed twelve-stock watchlist; every week it re-sizes what it already holds to equal risk contribution without changing the constituents. Costed against Zerodha's real charge stack, with an in-app alert on every order.
View details