Tag: quant

Correlation vs. Returns & Volatility

The previous post presented historical NIFTY 50 constituent pair-wise correlation distributions and discussed how high correlation environments persist. How do the 5th-quintile return and volatility look like?

If you focus on the 5, 10 and 20-day pair-wise correlations (T5, T10 & T20), you’ll see large left-tailed returns and high volatility in the 5th quintile compared to the others (1st, 2nd, 3rd & 4th).

Looking at this the other way, T10 – the 10-day pairwise correlation – has this profile:

It looks like if you dodge the 5th quintile here, you might be able to boost returns in linear strategies.

Index pair-wise Correlation

Sometimes, it feels like all stocks in an index are moving in the same direction. Very rarely is there full “chaos.” Sometimes, even when there is some dispersion, it is overshadowed by larger moves in a few index heavy-weights. To get some intuition around this, we calculated the pair-wise correlation of the NIFTY 50 constituents since 2015 across different lookbacks, bucketed the median daily correlations into quintiles and plotted them.

If you do an rle, you’ll get an idea about the number of consecutive days spent in each quintile. It looks like quintile 5, representing a highly correlated state, is sort of sticky.

For example, if you zoom into the 20-day lookback distribution, notice how quintile 5 stands out.

It appears that low-correlation environments are actually not that sticky. So, if you see a quintile 5 form, bet on it lasting a few days.

Mahalanobis Distance with Trend

Previously, we constructed a portfolio that switches between equities and bonds based on the Mahalanobis distance between them. Here, keeping everything else the same, we add a trend filter to the same set of indices.

The composite regime-switching model ends up with superior Sharpe Ratios. However, if you don’t switch to bonds (and stay in cash, earning zero), then you maybe better off with a simple trend model.

The alpha seems to be in earning the risk-free rate when things are “bad” and getting long equities only when things are “favorable.”

Code and charts are on github.

Mahalanobis Distance

We are big fans on using distance measures while prospecting for investment strategies. Previously:

Recently, we came across an interesting paper, Skulls, Financial Turbulence, and Risk Management, Mark Kritzman, CFA, and Yuanzhen Li, that uses the Mahalanobis distance to construct a turbulence index. The basic idea is that the more asset returns break from the past, the more “significant” a market event.

We took the basic intuition behind this and constructed a portfolio that switches between equities and bonds based on the Mahalanobis distance between them.

The out-of-sample results, factoring in transaction costs, look promising but doesn’t really stand out compared to other, more dumber, strategies that avoid steep drawdowns. However, two points over the Midcap buy & hold cannot be dismissed outright.

The code, charts and paper are on github.

Adventures in Pattern Matching, Part I

Hypothesis: If a price segment is similar to a set of historical segments, then there should be a correlation between historical and future returns.

Setup: Take 60-minute segments of 1-minute bars. Match them with 200 of the most recent days’ with times aligned. Take the top 40 days with the closest match and calculate their median next 30-minute returns. Plot the median vs. actual.

Simplifications:

  1. Non-overlapping segments. Its can be argued that patterns don’t start and stop and perfectly aligned boundaries.
  2. Most-recent 200 day look-back period. What if that’s not enough? Or too much?
  3. 30-minute prediction. Too short? Too long?

Verdict: There is no discernable relationship.

Code: github

Related: Euclidean Distance for Pattern Matching