Category: Investing Insight

Investing insight to make you a better investor.

Systematic Buy-the-Dip, SMA crosses

Previously, we looked at a dip buying strategy based on how low an index is trading below its peak. We now run some numbers against another popular strategy: the SMA crossover.

Introduction

Everybody wants to buy markets that are trending up. When a lower SMA (say, 3-day) crosses an upper SMA (say, 200-day) an uptrend is identified. What if one only buys when such a crossover occurs? What if one accumulates cash otherwise and collects interest while waiting for such crosses?

The following chart shows the periods in which NIFTY is below the upper SMA in red. Purchases are shown as green dots.
NIFTY cross-over

Here’s the one for the small-cap index:
small cap cross over

Results

We calculate the min, max and mean difference in the final amount of the index accumulated over rolling 5-year periods. The second column in the table below is the lower SMA used in the cross-over.
difference in assets accumulated

When it comes to small-caps, there are some configurations where, on average, the cross-over strategy accumulates more assets. However, investors are taking a risk where they could encounter 5-year periods where there is a shortfall in assets by an equal amount.

Waiting for the dip using this strategy is not a good idea compared to a simple daily SIP.

Note that we define success as the terminal value of the number of units of the index purchased. This is different from each unit being profitable.

Code is on github.

Systematic Buy-the-Dip, an Update

We had looked at the difference between buying the dip vs. a daily SIP back in June-2016 (link.) The following is an update and an expansion of the same idea.

Introduction

Everybody wants to “buy the dip.” We wanted to run some numbers against what investors would typically do if they were to follow such a strategy.

  • We invest Rs. 1 every day the market is open.
  • For SIP, we buy Rs. 1 of a particular index.
  • For DIP, we either invest in cash or we liquidate the cash account and buy the index (if there is a ‘dip’), and we continue to invest Rs. 1 in the index as long as it is in DIP.

To define a DIP, we need two things.

  1. The look-back (formation) period over which percentage loss from peak is observed.
  2. The threshold percentage loss from peak.

The scenario will continue to be in DIP as long as the index is trading a threshold percentage below its peak.

The following shows the periods in which the NIFTY was purchased in red. The look-back period was 100-days and the threshold was -10%. This translates to “buy the index only when it is trading 10% below its previous 100-day peak.”

NIFTY buy the dip

Here’s the one for “buy MIDCAP only when it is trading 15% below its previous 200-day peak.”
MIDCAP buy the dip

We expand on our previous attempt by adding more indices and running the scenario through rolling 5-year periods. We then compare the terminal value of the number of units of the index purchased under DIP with SIP.

Results

buy the dip results

There are very few scenarios where DIP buying is better than SIP buying. This happens to the NIFTY when you buy it when it is trading 20% below its 100/200/500-day peak. However, this is “on average.” There were 5-year periods when DIP buying would have resulted in about 5% less assets than SIP buying under the same lookbacks.

Hence, we reassert our previous finding that waiting for the dip is not a good idea compared to a simple daily SIP.

Note that we define success as the terminal value of the number of units of the index purchased. This is different from each unit being profitable.

Code is on github.

Buying at highs and lows: Thinking in Probabilities

Mining past returns of the MIDCAP 100 index, if you invested for 50 days, the probability of returns greater than 10% is 32% and the probability of returns greater than 15% is 18%. On the flip side, over the same holding period (HP,) the probability of returns lesser than 0% is 35% and the probability of returns lesser than 5% is 52%. These data points are the first row of the following tables:

MIDCAP 100 return probabilities: buy and hold, lows and highs
MIDCAP 100 return probabilities: buy and hold, highs and lows

Suppose you want to hold for 50 days, then to maximize your returns, you will have to buy at the 500-day low to have an even shot at making a return greater than 10%. The better outcome would be if the holding period were to be extended to 200 days. At which point the probability of even making less than 5% is very low and that of making more than 15% is more than 80%.

Using this table, one can lookup the odds of different holding period returns at different highs and lows.

Code is on github.
Related: Highs and Lows

Lumpsum vs. SIP: Thinking in Probabilities

This is a continuation of Lumpsum vs. Dollar Cost Averaging (SIP) that modeled different return series and concluded that a prudent investor would be better off with a SIP because of a smaller probability of incurring a large loss. However, we stopped short of comparing different indexes to see if the conclusion held.

The ‘average’ return

What happens if we take the average weekly return of an index and create a synthetic index that just gives those average returns without any variance? We end up with a parabolic looking cumulative return profile below:
cumulative small cap returns
The small cap index was chosen on purpose to illustrate how ‘average’ returns relate to real returns on an extremely volatile index.

The average return series is, of course, a fantasy. What we are interested in is in the probability of getting those returns.

Probabilities

Just like our first post, we start by modeling the returns of the NIFTY 50, MIDCAP and SMLCAP indexes as a Generalised Lambda Distribution and running a 10,000 path simulation to obtain a series of DCA vs lumpsum investment returns. We then feed that into a empirical cumulative distribution function so that we can query it for probabilities under different thresholds. To put that in a picture:
lumpsum vs SIP returns on small caps

The vertical lines mark the different thresholds we are interested in.

  • The grey line on the left is at zero. We have SIP showing a 4.44% probability of negative returns and lumpsum showing 3.49%. Yes, there is a non-trivial possibility that SIPs will give negative returns. However, looking at the shapes below zero, SIP losses may not be as large as lumpsum losses.
  • The red line in the middle is the start to finish return of the index. Here, we have SIP showing a 22.69% probability of exceeding those point-to-point returns and lumpsum showing 57.50%.
  • The orange line on the right is the compounded ‘average’ return. We have SIP showing a 7.82% probability of exceeding that and lumpsum showing 37.20%.

Here is the same MIDCAP:
MIDCAP lumpsum vs. SIP return densities

And for NIFTY 50:
NIFTY 50 lumpsum vs. SIP densities

What does all this mean?

  1. It is possible for SIP returns to be negative over large periods of time. Enough to cover your entire investing lifetime. So, if you are investing in small-caps, make sure you are not 100% allocated to it.
  2. Lumpsum investing gives you a higher probability of higher returns across all indexes. The probability of negative returns are on par with that of SIP’s.
  3. Lumpsums have fatter left tails. However, if you are looking only at NIFTY 50 and MIDCAP, those probabilities are tiny.
  4. Lumpsums have a higher probability of achieving ‘average’ returns compared to SIPs.
  5. Lumpsums seem to be benefiting from “time in the market” on indexes that rise over a period of time.

Code and charts on github.

Highs and Lows

With the recent correction in the markets, there are a lot of lazy headlines out there screeming “Midcap Index hits 52-week lows!” First, there is nothing significant about 52-weeks.

Second, if you are worried about 52-weeks, then you shouldn’t be invested in midcaps. Most investors see this:


When they should be seeing this:
.

An excerpt from the book “Thinking in Bets” seems appropriate here:

Our problem is that we’re ticker watchers of our own lives. Happiness (however we individually define it) is not best measured by looking at the ticker, zooming in and magnifying moment-by-moment or day-by-day movements. We would be better off thinking about our happiness as a long-term stock holding. We would do well to view our happiness through a wide-angle lens, striving for a long, sustaining upward trend in our happiness stock.

Now read Pain is proportional to Frequency of Observations that I wrote back in 2016.

Code and other charts are on github.