# Tag: VIX

## Hamming Distance

Previously, we discussed how removing information from data can be useful. And our discussion on using Euclidean Distance for Pattern Matching showed how you can use a rolling window to identify matching segments within a time-series. What if we mix the two ideas together?

If you transform a time-series of returns to 0-1, then we can use Hamming distance, a measure the minimum number of substitutions required to change one string into the other (Wikipedia,) as a measure of similarity.

For example, take the most recent 20-day VIX time-series and “match” it with a rolling window of historical 20-day VIX segments and sort it by its Hamming Distance.

## Euclidean Distance for Pattern Matching

Most of us have learnt how to calculate the distance between 2 points on a plane in high school. The simplest one is called the Euclidean Distance – a pretty basic application of the Pythagorean Theorem. The concept can be extended to calculate the distance between to vectors. This is where it gets interesting.

Suppose you want to match a price series with another, ranking a rolling window by its Euclidean Distance is the fastest and simplest way of pattern matching.

For example, take the most recent 20-day VIX time-series and “match” it with a rolling window of historical 20-day VIX segments and sort it by its Euclidean Distance (ED.)

Here, the ED has dug up a segment from November-2010 as one of the top 5 matches. Take a closer look:

While not a perfect match, it “sort of” comes close.

Sometimes, a simple tool is good enough to get you 80% of the way. This is one of them.

## VIX and Equity Index Returns, Part II

### Holding-period back-test

In Part I, we ran a quick back-test that would go long the equity index if the VIX was in a certain quintile and saw how the 5th quintile produced the lowest draw-down returns. The index was held only for a day. However, our box-plot of VIX quintile vs. subsequent n-day returns begs us to look at alternate holding periods as well. What would the returns be if we held onto the index beyond a day?

Here is how long-only S&P 500 returns when VIX is in the 5th quintile, across different holding periods looks like:

The problem with this strategy is that when there is a steep fall in the index, the VIX keeps going higher and will be in the 5th quintile for an extended period of time. Have a look at the 2008-2009 segment in this chart:

What happens if we used the change in VIX to time the equity index?

### VIX returns deciles

If we bucket VIX returns (percentage change over previous close over n-days, 1000 trailing observations) into deciles and observe the next 5, 10, 15 and 20-day returns of the underlying index over them:

There is no determinable pattern here. Perhaps the VIX and the index are co-incident with none holding the power of prediction over the other.

Interested readers can browse the github repo for corresponding Nikkei 225 and NIFTY 50 charts.

## VIX and Equity Index Returns, Part I

The VIX is a measure of implied volatility of the underlying index. For example, the CBOE Volatility Index is a measure of 30-day expected volatility derived from S&P 500 Index call and put option prices, India VIX similarly uses the NIFTY 50 call and put options prices to derive a measure of volatility. The question we will try to address in this series of posts is whether the VIX can be used to time entries and exits on the underlying index.

### The VIX time-series

The VIX on S&P 500 has been around since the 90’s whereas India VIX started out around 2009. Moreover, the US enjoys a much wider and deeper market for volatility products than any other market in the world. VIX futures, VIX options, VIX of VIX, volatility ETFs and their inverse, all trade fairly well. Whereas in India, even though VIX futures have been listed for a while, it rarely trades. Trading activity of a derivative (VIX, in this case) invariably has an effect on the underlying (S&P 500, NIFTY 50…) So we expect the relationship between S&P 500 VIX and the S&P 500 index to be closer than that between India VIX and the NIFTY 50 index.

### VIX quintiles

To begin, we will bucket the trailing 1000-day VIX closing prices into quintiles and observe the next 5, 10, 15 and 20-day returns of the underlying index over them.
S&P 500 VIX

And, more recently:

What is striking here, is that subsequent returns off the 5th quintile (when VIX is at its highest) is higher with smaller negative outliers than returns off the 1st quintile (when VIX is a its lowest.) This is counter-intuitive to the notion that “volatility begets volatility” so investors are better off staying away from the market when it is volatile.

India VIX and NIFTY 50 shows a similar pattern*:

*Smaller sample compared to the S&P 500 dataset.

### A simple back-test

What happens to a long-only portfolio if it is long the index only when the VIX is within a particular quintile?
S&P 500/VIX

The strategy that is long when VIX is in the 5th quintile (L5) out-performs the other quintile strategies. Also, if you ignore the 2008 collapse, L5 has the shallowest of drawdowns.
NIFTY 50/VIX
Something similar happens with NIFTY 50 as well:

### Implications

Cash-only investors can point to the superiority of buy&hold compared to these VIX-based strategies. However, the shallow drawdowns exhibited by the L5 strategy (long index when VIX is in the 5th quintile) is attractive to leveraged traders. For example, NIFTY 50 futures leverage is between 8x and 10x. So even if you play it safe and leverage only 5x, L5 returns would end up at ~100% compared to buy&hold’s 80% over the same period.

We will dig deeper in the next part of this series. Stay tuned!

Code and more charts are on github.

## Volatility and VIX Charts

Our Volatility and VIX Collection had some charts that were more than two years old. This post updates some of those charts and will re-create them more often.

Volatility can be measured in a number of ways and its profile changes based on the look-back period. The parameters are selected based on what the volatility estimate is used for. Moreover, no two indices exhibit the same profile – traders need to be vary of transplanting trading strategies that work for one market into another.

### Historical volatility density plots

#### 20-day historical volatility plots

US S&P 500

Japanese Nikkei 225

Indian NIFTY 50

### Implied volatility

Code and a lot more charts are on github.