Different sectors of the stock market perform well at different times. There are periods when banking and financial services lead the market, while at other times IT, pharma or energy perform better. I was interested in testing whether recent sector performance could be used as a basis for portfolio allocation.

The idea behind momentum investing is to select assets that have performed well over a recent period, with the assumption that some of that performance may continue.
I built a simple sector rotation model in Python using synthetic monthly returns for 10 sectors from January 2016 to October 2026. These included Banking, IT, FMCG, Pharma, Auto, Metal, Energy, Realty, Infrastructure and Media.
At the beginning of each month, the script ranks the sectors based on their returns over the previous six months and allocates the portfolio equally across the three highest-ranked sectors. The portfolio is rebalanced monthly, with a transaction cost of 0.2% applied to the portion of the portfolio that changes.
I compared this with two other approaches: holding all 10 sectors equally and holding the three lowest-ranked sectors.
The top-three momentum portfolio generated a CAGR of 9.6%, compared with 7.4% for the equally weighted portfolio and 1.9% for the bottom-three portfolio.
However, the higher return also came with a larger maximum drawdown. The momentum portfolio experienced a drawdown of 32.4%, compared with 28.4% for the equally weighted portfolio. Annualised volatility was also slightly higher at 16.1% compared with 15.4%.
Another observation was that the momentum portfolio outperformed the equally weighted portfolio in only 53% of the months. On average, approximately 27% of the portfolio allocation changed each month, making transaction costs an important consideration.
Energy appeared most frequently among the top three sectors in this particular simulation, followed by FMCG and Pharma.
One thing to keep in mind is that the synthetic data was generated with persistent sector-specific return patterns. This creates conditions that favour a momentum strategy. The results should therefore be understood as a demonstration of the strategy rather than evidence that it works in the Indian stock market.
I would like to repeat this using actual NSE sector index data and compare different lookback periods, rebalancing frequencies and transaction costs. It would also be useful to check whether the additional return justifies the higher drawdown and portfolio turnover.
This is a personal financial modelling experiment using Python, not an investment recommendation.