Category: Investing Insight

Investing insight to make you a better investor.

A Brief Note on Monte Carlo

When we back-test a strategy against the historical prices of an instrument, say, the NIFTY 50 index, we have to keep in mind that historical values are just one path of the many paths that the instrument could have taken.

For example, 10 tosses of a fair coin can result in TTTTTFFFFF and TFTFTFTFTF with equal probability. If your strategy is path dependent (as most strategies are,) then just because it was successful in one trial (historical prices) doesn’t mean that it would have been successful in all (or majority) of them.

The simple thing to do after a successful back-test against historical prices is to run a Monte Carlo simulation to check if the strategy comes out ahead in most of them. This can be setup by assuming returns are normally distributed and running a simulation using the mean and standard deviation of the sample.

For instance, in the recent past, daily NIFTY 50 returns have exhibited a mean of -0.0003742873 and std. dev. of 0.01079387. When you run a simulation and plot the results over the actual closing prices of the index, you get the resulting chart:

monte-carlo.NIFTY

How many of these paths will result in a total equity wipeout of the back-tested strategy?

Market-Cap Deciles, Part III

Part I, Part II of the series.

111% vs. 11%

A portfolio of ~150, equal-weight, small-cap stocks, rebalanced monthly, gave a return of 111% from 2015 through now.

decile.9.2016-04-24

While a similar portfolio of mega-cap stocks gave a return of 11% during the same time frame.

decile.0.2016-04-24

Variance

Returns from the small-cap portfolio are accompanied by larger volatility.

decile.distribution.9.2016-04-24

decile.distribution.0.2016-04-24

Accessibility

Is the alpha accessible? Given the meager volumes in the small-cap space, narrow circuit breakers and intra-day volatility of prices, small-cap alpha is hard to access. The impact cost of trading 150 small-cap stocks every month would be pretty high for large positions.

However, a portfolio with an exposure of Rs. 10,000 – Rs. 50,000 per stock is doable. So, theoretically, you can size the portfolio between Rs. 15,00,000 – Rs. 75,00,000 to access this alpha.

Appendix

Cumulative wealth charts for each decile (both cap- and equal-weighted): (a)

Box plots of cumulative returns of stocks in each decile: (b)

Introducing the Global Macro Dashboard

It is all local until it is not

World markets just witnessed a spiraling sell-off that caught most investors off-guard. The problem is that for most of the time, markets are local. Except for those times when they aren’t and correlations go to 1.

We tried singling out different factors to check if they could act as leading indicators of market sell-offs:

It is not one thing and it is never the same thing

The problem is that, statistically, no one global indicator is going to be a perfect canary in the coal mine. However, once the number of “meaningful” events crosses a threshold, correlations tend to 1.

But what exactly defines “meaningful?” Is it 1-sigma or 2-sigma? Should it be change in price or price itself? What should be the number of periods over which these statistics are calculated? The answers to these questions are going to take a while to figure out. In the meantime, we decided to create a dashboard that lets investors choose some of these filters.

You can play with our Global Macro Dashboard here: StockViz/GlobalDashboard

Welcome to glocal markets.

Macro Volatility and the NIFTY 50

This post is a continuation of our exploration of trying to use macro market indicators to time the NIFTY 50. See World Markets and the NIFTY 50 and India VIX vs. SPX VIX.

Perhaps the problem with using price moving averages was that the major moves were already done before we could short the NIFTY. What if we used volatility instead? Here is how the median of 10-day volatility of major world indices looks like:

macro.volatility

What if we went long only when volatility was below the median and went short otherwise?

macro.trade.a

Looks like the strategy works only in avoiding the 2008 crash. Using observed volatility to time trades doesn’t work. One more to the reject pile.

World Markets and the NIFTY 50

global.etf.performance.2015-12-30.2016-02-08

Global markets have sold off in tandem so far this year. The question on everyone’s mind is if markets are correlated during sell-offs, then is it possible to construct a “world markets indicator” that will allow traders to short the NIFTY?

Constructing an SMA index

There are about 40 world index ETFs listed in the NYSE that provide a dollar based proxy to world equity markets. Using historical data, one can construct an index that tracks the fraction of these markets that are trading above their simple moving averages (SMAs.) If the index dips below a certain level, it could mean that a macro sell-off is in progress and one could proceed to short the Nifty. We constructed a 5- 10- and 50-day index of global market ETFs:

macro.sma

Using the SMA index to trade

So what if we used the SMA indices to go long and short the NIFTY? What we did below was to go short the NIFTY if the fraction of world markets trading below their SMAs were below their historical medians and long otherwise.

macro.trade

Between 2007 and now, the 5- and 10-day SMAs (black, red) under-perform a buy-and-hold (blue) strategy. However, the 50-day strategy (green) helped short the 2008 crisis and the current sell-off.

But let us zoom into the period between 2011 and 2014:

macro.trade2

This is where macro under-performs buy & hold (negative returns vs. positive.)

Year-wise returns of the different strategies:

Year 5-day SMA 10-day SMA 50-day SMA Buy and Hold
2007
50.58%
7.01%
12.03%
54.77%
2008
-2.51%
65.04%
69.88%
-51.79%
2009
-20.12%
-37.06%
18.47%
75.76%
2010
-4.11%
-23.86%
-19.11%
17.95%
2011
-24.00%
-16.30%
7.68%
-24.62%
2012
14.09%
16.66%
1.22%
27.70%
2013
-19.15%
6.02%
-8.94%
6.76%
2014
1.07%
-1.97%
-1.17%
31.39%
2015
13.56%
-4.39%
25.32%
-4.06%
2016
-4.77%
-4.60%
-6.13%
-7.04%

Conclusion

  • Given the volatile nature of the SMA World Indices, expect to take a fairly large hit on trading costs.
  • The 50-SMA based strategy under-performed buy and hold in 6 out of 9 years.
  • The 50-SMA based strategy under-performed buy and hold in 3 consecutive years – 2012, 2013 and 2014 – making it a hard strategy to be faithful to.

Related: India VIX vs. SPX VIX