Category: Investing Insight

Investing insight to make you a better investor.

Monitoring Network Glitches

More often than not, real time feeds are exposed as web socket streams. Web sockets are extremely sensitive to network glitches. Glitches – when the connection drops for a very small span of time – will cause your market data to lag badly as your client tries to reconnect/re-establish the feed, eventually leading to catastrophic failure.

The problem with glitches is that it is hard to work around. A complete drop in the connection can be handled by a router that can switch over to a backup connection. Glitches are more sinister.

For example, we have broadband connections from three different service providers (Hathway, Excitel and BSNL) to make sure our systems can stay connected. They all have varying degrees of stability and customer service. Here are the number of glitches per hour over the last few days:

You can work around 1-2 glitches an hour by making your re-connection logic more robust. However, there is no getting around the Hathway level of glitches.

If your service provider itself is not monitoring for glitches, then explaining the problem to them is impossible. Support tickets get closed because “network is connected.” Here is a history of our support tickets with Hathway – an ongoing saga with no end:

As you scale, monitoring your infrastructure becomes increasingly important. Be aware that your service provider could be (willfully) blind to the specific issues you are facing – their job might depend on them not solving it. And, always have a backup and a backup for your backup.

The python code to monitor for glitches and the R code to draw the charts are on github.

Volatility as Beta

The volatility risk premium (VRP) is the difference between implied volatility and realized (or actual historical) volatility. Implied volatility is, on average, overpriced compared to realized volatility.

The VRP exists because investors are essentially “selling insurance” when they sell implied volatility.

Volatility is negatively correlated with equity returns; typically, volatility increases when equity markets decline. Therefore, a short volatility position is implicitly “long equity risk”. Since equities are generally expected to earn an equity risk premium (ERP) over the risk-free rate, strategies that are implicitly long equity risk should also be abnormally profitable. This is why short volatility strategies tend to be profitable on average.

Just like how you can get long ERP by getting long an equity index, you should be able to get long VRP by programmatically shorting options and delta-hedging them. Volatility becomes a beta that you allocate towards.

Building Blocks

An option’s value changes relative to the price of the underlying – the rate of this change is called delta.

Gamma is the rate of change of delta given a change in the price of the underlying. As the underlying price moves, an option’s delta does not remain constant; gamma quantifies how much that delta will change.

Since we are only interested in volatility and not price, we can hedge out this delta. Delta-hedging a basket of options mitigates the exposure to the directional movement of the underlying. Profitability becomes solely determined by the volatility (not direction) of the underlying.

Vega is the rate of change of an option’s value relative to a change in implied volatility (IV). If IV rises or declines by one percentage point, the value of the option is expected to rise or decline by the amount of the option’s vega, respectively.

When you short options, you have negative gamma (you don’t want large price movements) and negative vega (you don’t want IV to rise). You hope for low realized volatility and falling IV. However, you have positive theta — time works in your favor.

Theoretically, a delta-hedged short option position’s P&L = vega(IV – RV).1

Construction

Historically, NIFTY ATM option Implied Volatility across days-to-expiry, looks like this:

So, theoretically, if you shorted 30dte ATM calls and exited them at 7dte, your P&L distribution will look like this:

And the same thing with puts:

If you are willing to treat volatility as just-an-other beta, then by creating programmatic delta-hedged short ATM straddle/strangle portfolio, you can get long this beta.

Just as it is with ERP, one could build models to time VRP. Having a beta portfolio as a benchmark should help.

  1. Volatility Trading, Euan Sinclair ↩︎

Intra-Stock Correlation and Momentum Returns

Vojtko, Radovan and Pauchlyová, Margaréta, How to Improve Commodity Momentum Using Intra-Market Correlation (SSRN) discusses using short-term and long-term correlations between constituents to bet on momentum and reversal.

Since we are always on the lookout for strategies for reducing momentum drawdowns, we did a quick check to find out if a similar strategy can be used for long-only momentum.

The rule is fairly basic. Using the momentum portfolio already formed, if 20-day average correlation between them is greater than 200-day average correlation, then go long, else, go to cash.

Ignoring transaction costs, it looked like it avoided the brutal 2018-2019 drawdown. So, we dived a bit deeper to see if it was materially better than our 50-day SMA idea.

Here, COR_RET represents using only correlations to go long/cash, SMA_RET represents using only SMA, EITHER_RET is correlation or SMA and COMBINED_RET is correlations and SMA.

Going long if either correlations or SMA (EITHER_RET) seemed to be a winning strategy. However, high transaction costs in India can turn any decent strategy into a loser in a heartbeat.

25bps in transaction costs negates most of the advantages of considering the correlation signal. However, the post-COVID data does point towards EITHER_RET outperforming SMA_RET.

The biggest disappointment for us was that there was no improvement in drawdown metrics but 5% of outperformance might be worth the additional complexity.

Code and charts are on github.

The High Volume Return Premium

Gervais, Simon, Ron Kaniel, and Dan H. Mingelgrin, 2001, “The high‐volume return premium,” The Journal of Finance, unearthed a market anomaly quite similar to momentum where stocks that traded with a higher than average volume went on to give higher returns.

We did a quick test on the top 200 stocks by free-float market cap on the NSE between 2014 and 2024 to check if it makes sense to pursue this further.

A long-only strategy that rebalanced once a month with a 50-day reference period underperformed the NIFTY 100 TR index by a wide margin until the August of 2023. Nine years of underperformance vs. a year of parabolic liftoff doesn’t really speak to the stability of the anomaly.

We’ll look for further publications in this area and report back. In the meantime, you can read the paper and have a look at our code here: github.

Commodities vs. Commodity Stocks

Trading commodities is not the same thing as trading commodity stocks. Commodity stocks, especially in partially-open economies like India, have their own cadence.

Take aluminum, for example. If you compare the MCX Aluminum Index with National Aluminum stock, the stock has vastly outperformed the metal.

While there is something to be said about the stock being more volatile than the metal, the difference is returns is night-and-day.

Stocks are evaluated on the basis of free-cashflow, earnings growth, return on capital, etc. While the prices of metals if mostly determined by short-term demand-supply imbalances.

Generally, Indian metal stocks have vastly outperformed the metals themselves.

If the government has erected tariff barriers to protect certain domestic industries, it makes no sense to try and link commodity prices to producer prices. Going back to our example, there is zero correlation between the monthly returns of aluminum vs. the monthly excess returns of National Aluminum (over the NIFTY 50 TR index) on any time frame.

Trading metals is completely different from trading metal stocks.

Code and charts on github.