Changepoints vs. Buy & Hold

A changepoint is a point in time where the statistical properties of a sequence change. For financial return series this typically means the mean, variance, or distribution of returns shifts — a stock that was trending sideways suddenly becomes volatile, or a calm market enters a turbulent regime.

Can we use changepoint detection to time exposure to the market and beat simple buy-and-hold, on a risk-adjusted basis, on India’s NIFTY indices?

First, we calculated an aggregate score using different changepoint algorithms to classify the return-series. This was done with both a sliding window and an expanding window of data.

Then, we tried the simplest use of the signal: be fully invested when STABLE, fully out when UNSTABLE. This binary approach underperformed buy-and-hold badly, on both return and Sharpe ratio, on every index.

Throughout the process, we kept a 50-day SMA as the base case to beat. It is a simple totem to keep us honest about the complexity vs. efficacy trade-off.

The problem with this binary approach is that volatility clusters – the worst days and the best days tend to occur together. However, changepoint is backward looking so you will end up catching the worst days and missing out on the best days.

To fix this, we added a direction condition: only treat instability as a reason to exit if the market is also in a downtrend (price below its 50-day moving average). Otherwise, stay invested through volatile-but-rising periods. It removes the worst part of the filter – exiting during uptrends.

metrics

The next step was to remove the binary nature of the strategy: size the position by mapping it to model confidence [0,1] and sizing only when the market is in a downtrend (close < 50-day MA); in uptrends, stay fully invested regardless of volatility.

metrics

This is how we narrowed in on Direction-Gated Continuous Sizing.

metrics

Sadly, using this technique instead of a basic SMA only made sense with the NIFTY 50 index. In every other situation, SMA won.

You can dig deeper here. Code and charts are on github.