Why usFeaturesTemplatesBlogGlossary

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.

qualitysector-neutralfactorconstraints
Universe
NSE Stocks XNSE
Rebalance
Quarterly Normalized score

How the pipeline works

Filter

NIFTY500 constituent

Keeps rows where nifty500_member == 1

nifty500_member == 1
Filter

Liquid: traded > Rs 5 cr/day

Keeps rows where turnover > 50000000

turnover > 50000000
Filter

Sector classified

Keeps rows where sector > 0

sector > 0
Calculate

Return on equity

Computes roe = net_profit_annual_consolidated / total_equity_annual_consolidated

net_profit_annual_consolidated / total_equity_annual_consolidated
Calculate

Debt to equity

Computes debt_to_equity = total_debt_annual_consolidated / total_equity_annual_consolidated

total_debt_annual_consolidated / total_equity_annual_consolidated
Filter

Positive equity and profit

Keeps rows where roe > 0

roe > 0
Score

Sector-neutral quality

Blends 2 factors into quality_score

Rank

Top 30 within sectors

Selects the top 30 by quality_score

Size

NSE score transform

Sizes positions: Normalized score

Constrain

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
Read the full write-up

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.