Tag: sip

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.

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.

Lumpsum vs. Dollar Cost Averaging (SIP)

Among Indian investors, SIPs (Systematic Investment Plans) are the rage right now. The total amount collected through SIP during May 2018 was ₹7,304 crore according to AMFI. SIPs are great for investors with a regular income – it matches the frequency of savings with the frequency of income. Structural discipline is always a welcome thing. However, for investors who have lumpy incomes or a windfall, it is often a dilemma whether to invest as a lumpsum or to setup an STP (Systematic Transfer Plan.)

Both SIPs and STPs are a form of DCA (Dollar Cost Averaging) where you average into an investment over a period of time (the accumulation phase.) The thing about DCA is that it ends up under-performing a lumpsum in markets that are trending up. Intuitively, you want to buy more when the price is low (in the beginning) and less when the price is high (at the end.) So, if the market is going up, then it makes no sense to spread a lumpsum over a period of time – you are guaranteed to make the later buys at a higher level, reducing your overall returns.

In the case of equity markets, the expectation is that they tend to go up over time. So if you are looking at a 10-20 year time horizon, then you are better off investing in one shot. To put this intuition to test, we modeled the returns of NIFTY, MIDCAP and GOLD as a Generalised Lambda Distribution (this works better than a normal distribution because these returns have significant skews and kurtosis) and ran a 10,000 path simulation to get a sense of the probability distribution of DCA vs lumpsum investments.

Roughly, this is like assuming that the weekly return distribution is going to be the same across 10,000 different worlds. So you pick set of random weekly returns from the same distribution 10,000 different times and see how DCA and lumpsum perform over those worlds. When you plot the density of those returns, you get an idea of how they compare.

To keep things simple, lets compare NIFTY MIDCAP 100 and GOLD. First, the price charts:

And now the simlulated cumulative return densities of MIDCAP and GOLD, modeled with data after 2010:

The area to the left of zero is that of negative returns. Lumpsums have a longer left tail compared to DCA so probability of a large negative outcome is higher for the former.
However, the total area under zero is higher for DCA in MIDCAPs so the probability of negative outcomes in general is higher for DCA/SIP.
Lumpsums have a fat right tail for both MIDCAPs and GOLD so the probability of large positive outcomes is higher for lumpsums.
“Average” DCA returns are less than “average” lumpsum returns but they occur with a higher probability.

For a prudent investor, it is the left tail that matters the most. Even though lumpsums hold out hope for higher returns (fat right tails,) they have a small probability of a big loss that is greater than that for DCA (longer left tails.) In conclusion, a prudent investor should convert a windfall into an STP and a risk-seeker should do a lumpsum.

For readers curious about the code and for additional charts with longer time periods, visit github.

Systematic Buy-the-Dip

Introduction

We often hear the term “buy-the-dip” whenever the markets are correcting. However, here are some questions that face an investor:

  1. What exactly is a “dip?”
  2. Where does the cash come from?
  3. How much should I buy?

The answers to these questions will determine how much alpha you will generate by employing this strategy.

What is a “dip?”

A dip is a percentage loss from a near-time peak (also called a drawdown.) For example, if the NIFTY posts a 50-day cumulative loss of 5%, then that is a 5% dip over where the NIFTY closed 50-days ago. To get a sense for how these 50-day dips/drawdowns are distributed, we do a density plot.

drawdown.density.NIFTY 50

drawdown.density.NIFTY MID100 FREE

As we can see, most of the NIFTY dips are at around 5%. A more than 10% dip is a “back the truck up” event where we deploy all our cash. For MIDCAPs, it is around 10% and 15%.

The back test

Every day, an investor has Rs. 1 that he needs needs to invest. He can either buy the NIFTY/MIDCAP or he can park it a short-term bond fund/savings account. Additionally, if it is a “back the truck up” dip, he can liquidate the bond fund and buy the NIFTY/MIDCAP. Let’s tag this as DIP.

In a DIP, the investor only buys NIFTY/MIDCAP if it is in a dip. Otherwise, he buys Rs. 1 worth of bonds.

The base case is that the investor buys Rs. 1 worth of NIFTY/MIDCAP every day. Let’s tag this as SIP.

Should you buy the dip?

Yes, buying the dip allows you to build a bigger corpus, if your transaction costs are zero. Here are the NIFTY and NIFTY MIDCAP buy the dip (DIP) vs. daily purchase (SIP) final corpus:

dip-sip

Given how small the alpha is, net of fees/commissions/slippage/taxes, this is a losing proposition. You are better off with a SIP.