Trend-Gated Momentum (Risk Off Below 200-DMA)
The Momentum 30 screen with one addition: the whole book only reconstitutes while the Nifty 50 is above its own 200-day moving average. When the index closes below it, the strategy exits to cash and waits. Adds a portfolio circuit breaker at 25% drawdown.
Why this is expected to work
A cross-sectional momentum screen always holds the best-ranked 30 names, even when all 500 are falling — "best of a bad universe" is still a full equity exposure into a bear market. Faber (2007) showed a simple 200-day moving-average rule applied at the index level cut maximum drawdown roughly in half across asset classes over 100+ years, with returns broadly intact, because it sidesteps the left tail where losses compound hardest. The cost is real and should be understood before deploying: the rule whipsaws in choppy sideways markets and will exit near lows and re-enter higher several times a decade. It is a drawdown trade, not a return trade. The circuit breaker is a second, independent stop that fires on the portfolio's own equity curve rather than the index.
How the pipeline works
Nifty above its 200-day average
Only runs while XNSE:NIFTY satisfies close > nifty_sma_200
NIFTY500 constituent
Keeps rows where nifty500_member == 1
nifty500_member == 1 Liquid: traded > Rs 5 cr/day
Keeps rows where turnover > 50000000
turnover > 50000000 Price 1 month ago
Computes price_1m_ago = @shift(close, 21)
@shift(close, 21) Price 12 months ago
Computes price_12m_ago = @shift(close, 252)
@shift(close, 252) 12-1 momentum
Computes momentum_12_1 = price_1m_ago / price_12m_ago
price_1m_ago / price_12m_ago Top 25 by momentum
Selects the top 25 by momentum_12_1
What this template teaches
- TickerFilterRule — gate the whole strategy on one instrument
- exit_portfolio_when_fail (go to cash, not "hold anyway")
- risk_controls — portfolio circuit breaker
- Combining a market-timing overlay with a stock-selection screen
The 200-Day Moving Average: A Drawdown Trade, Not a Return Trade
One of the simplest market-timing rules ever tested roughly halved maximum drawdown across a century of data without giving up much return. It also whipsaws, and you should know that before deploying it.
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