Author: shyam

Macro: NIFTY vs. INR/OIL Correlation, Part II

This is a continuation of the correlation study of Part I
Our correlation study showed a -0.54 between NIFTY 50 and USDINR whereas a 0.21 with OIL. Here, we will use weekly returns of the NIFTY and USDINR to build a simple linear model.

Building a linear model

A weak correlation doesn’t usually lend itself to a useful linear model. To illustrate this point, have a look at the diagnostics below:
NIFTY~INR linear model
Ideally, the ‘Residuals vs. Fitted’ plot should show residuals evenly distributed around the zero line – it doesn’t. The Q-Q plot should lie on the diagonal – it is marred by heavy tails. Hence, we should scale-down our expectations from the model.

For this post, we will split the time-series that we have into a “training set” that goes from 2010-01-01 to 2015-12-31 and a “test set” that goes from 2016-01-01 to 2018-09-30. We will build the model with the former and test it with the latter.

Results

Predicted vs. actual weekly NIFTY 50 returns:
actual.vs.pred.NIFTY50
To test our model, we will give it the actual NIFTY 50 returns (x-axis) and plot the predict NIFTY 50 returns (y-axis.) The problem here is immediately apparent: it is heavily bullish! It consistently gives a positive prediction.

Long and Long-short cumulative returns:
linear.model.cumulative.NIFTY50
If we use our model to go long-only (L) or long-short (LS), we get the cumulative returns shown above. The model is no better than buy-and-hold (at least it is no worse, so there is that.)

Take-away

A weak correlation between NIFTY 50 and USDINR is not much to work with and a linear model built over that relationship is no better than buy-and-hold. Given the narrative spun by the media, it is tough to wrap ones head around the results above.

We conclude with density charts of weekly NIFTY returns under different USDINR return thresholds in Part III.

Code and charts on github.

Macro: NIFTY vs. INR/OIL Correlation, Part I

We have all come across these type of headlines recently:
Sensex, Nifty fall further on surging crude oil prices (LiveMint)
Sensex, Nifty drop on fresh spurt in oil price, fall in rupee (ET)
But what exactly is the correlation between the NIFTY, USDINR and OIL?

Macro Caveats

A host of factors affect the prices of a widely tracked benchmark index like the NIFTY. Some of which are intrinsic (valuation, for example) and some that are external (capital flows, for example.) There relationships are dynamic – they keep changing over time.

Also, macro variables usually have a time-alignment problem. For example, the closing-prices of the NIFTY don’t align with the closing prices of, say, the NASDAQ. So to analyze the NIFTY and NASDAQ together, the time-series need to be shifted. And, perhaps, NASDAQ futures being traded at NIFTY close should be considered instead.

Comparing commodity and currency time-series with equity time-series has another problem. The former trades 24/7 in a global marketplace whereas equities predominantly trade in the local time-zone. So “closing” prices for commodities and currencies are hard to pin down at a granular level across markets. One way to tide over this issue is by using a weekly or monthly time-series instead of a daily one.

Time-periods

For the longest time, Indian markets were insulated from global capital flows. It is only recently that we have opened up both or economy and our markets. Currency futures started trading only in 2008 and the RBI still tries to “guide” the exchange rate. With these in mind, lets run the correlation between the NIFTY 50, USDINR and OIL weekly return time-series with NIFTY 50 lagged by on time-period.

NIFTY50.INR.OIL correlations

Data from 1995 through 2018 shows only a small correlation between NIFTY and INR. However, like we mentioned above, Indian markets now are more open than what they were before. So, if you run the same correlations on a smaller dataset – year 2010 through 2018 – we can see an uptick in the NIFTY-INR correlation.

NIFTY50.INR.OIL correlations

Take-away

It appears that the NIFTY has a closer relationship with INR than with OIL prices. In Part II of this thread, we will check if we can build a linear model that can capture this relationship. Stay tuned.

Code and charts are on github.

Broker Industry Snapshot 2018-09

There are a lot of conflicting statistics regarding the brokerage industry in India. Depending on the source of the data and what gets counted, one ends up with different numbers. The numbers vary depending on whether only unique demat accounts (based on PAN) are measured, the definition of an “active” account, whether purely derivative accounts are to be included, etc. The NSE has been publishing aggregated statistics for “active” accounts (measured by UCC) for different brokers for a while now. Below are some charts constructed from that data.

Number of active accounts

It looks like SEBI’s drive to redefine an “active” account lead to large scale deactivation of accounts in 2013-14. Duplicate accounts notwithstanding, you could tell that its a bull market by the 40% jump in active accounts between FY2016-17 and FY2017-18. However, 80 lakh total active accounts looks skinny.

The changing face of the industry


According to the latest numbers available, top 20 brokers by market-share (based on number of active accounts) had cornered 76% of the market, compared to 69% back in FY2010-11. The top 5 have further widened the lead with the rest. However, there has been a lot of churn in the leadership. At current growth rates, it appears that it is only a matter of time before discount broking displaces full-service broking.

We don’t have much more to add at this point but we will keep yanking on this thread over the days to come.

Timing Entries and Exits based on Profits and Drawdowns

We previously looked at a couple of popular “buy the dip” strategies – one based on SMA crosses and another based on drawdowns – and showed how they underperform a systematic daily SIP. Further, we showed how a daily SIP is not that different from a monthly SIP here. These studies were based on maximizing the terminal asset size. i.e., a strategy was labeled superior if it accumulated the maximum number of units of an index, mutual fund or stock. They weren’t trading strategies trying to maximize profits but investment strategies looking to maximize assets. Here, we turn our gaze to a strategy that lies in between investment and trading – exiting based on profit-booking and re-entering.

Book profits and re-enter

We often hear media pundits asking their followers to “book profits and re-enter at a lower level.” We wanted to see if it can be quantified systematically. What exactly does it mean in numbers? Is it better than buy and hold? So, we setup a backtest:

  1. Start with a long
  2. Once the long reaches a profit threshold, exit.
  3. Stay out of the market until a drawdown point has been reached and then re-enter.
  4. Do this for NIFTY 50, MIDCAP 100 and SMLCAP 100 indices.

Results

The tables below collate returns for 10-year rolling windows.

NIFTY 50
NIFTY MIDCAP 100
NIFTY SMLCAP 100
‘BH’ indicates buy&hold.
‘RET_SEN’ and ‘RET_MAX’ are the scenarios that produce the best returns, respectively.
‘IR_SEN’ and ‘RET_IR’ are the scenarios that produce the best information ratio and its corresponding returns, respectively.

As you can see, there is no clear winner here. However, there are some configurations that seem to repeat. For NIFTY 50, it appears to be 35%:10% i.e., sell once returns have reached 35%, re-enter on a 10% correction. For MIDCAP, you could probably go with 70%:10% and for SMLCAP, 80%:15%. Below are their respective cumulative and yearly return charts:

NIFTY 50

NIFTY 50 entry/exit
NIFTY 50 yearly

MIDCAP 100

MIDCAP 100 entry/exit
NIFTY 50 yearly

SMLCAP 100

SMLCAP 100 entry/exit
SMLCAP 100 entry/exit

Applying the strategy to MIDCAP and SMLCAP seem to have some merit. However, when you look at the yearly returns chart, it is obvious that a bulk of the out-performance came from just two or three years of the ~20 year dataset. Another key observation here is that these strategies do not offer any significant downside protection. Also, these back-tests do not incorporate the tax impact and transaction costs of these strategies.

Takeaway

“Book profits and re-enter at a lower level” may sound like a nice thing to do but there is no consistent rule that can be applied that can justify the added costs and tax impact.

Code and more charts on github.

ETF Premium/Discount to NAV

Every Exchange Traded Fund (ETF) in India has a mutual fund counterpart. From a regulatory point of view, only mutual fund asset management companies can setup ETFs and an ETF is a special type of mutual fund that happens to trade on a stock exchange. This dynamic allows us to compare ETF closing prices (or last prices, pick your poison) with the corresponding mutual fund NAV to gauge the premium or discount that the ETF is trading at the exchange over the fund.

The calculation is fairly straightforward, it is simply CLOSE/NAV-1. A positive number implies that the ETF is trading at a premium. A negative implies a discount.

Imagine a scenario where you buy an ETF when it is trading at a premium, say, 5%. Suppose the index that it is supposed to track is up 5% and you decide to bank it. You open up your trading terminal and Whoa! The price of the ETF has barely moved. This is because the premium has collapsed and has taken your paper profits along with it.

Think 5% is too much of a difference? Think again. Here is a box plot of the premium/discount of various ETFs over the last year:
mf etf premium discount of closing prices BOX plot
The red dots on the charts are outliers. The black line in the middle is the average. Ideally, you want the box to be narrow with no red dots.

The differences cannot be explained away by the popularity of the underlying indices. For example, have a look at NIFTYBEES (from Reliance) and NIFTEES (from Edelweiss.) They both track the tremendously popular NIFTY 50 index but only the former has decent volumes and hews closer to NAV.

Also, the premiums/discounts vary widely. EQ30 is a glaring example of how widely off the mark an ETF could trade.

Investors who use ETFs to create asset allocation portfolios should be especially aware of this phenomenon. A rebalance could very well wipe out mark-to-market profits if it doesn’t take this into account. Moreover, this is not something that is typically modeled in backtests.

Here is a chart of the daily premium/discount over the last one year for the ETFs used in our EQUAL-III Theme:
EQUAL III portfolio premium/discount

Forewarned is forearmed!

Code and charts are on github.