Category: Investing Insight

Investing insight to make you a better investor.

USDINR and Dollar Indices, Part I

The St. Louis Fed publishes a number of economic and financial series on its Federal Reserve Economic Data (FRED) database. It is a treasure trove of information for quants. There are a number of currency related time-series in the database. In this post, we will plot the USDINR exchange rate with the trade-weighted indices available on FRED to explore any relationships that there might be between them.

Trade-weighted indices

A trade-weighted dollar index is simply the weighted average of the foreign exchange value of the U.S. dollar against the currencies of a group of U.S. trading partners. The FRED publishes the following such indices:

  1. DTWEXB: Includes the Euro Area, Canada, Japan, Mexico, China, United Kingdom, Taiwan, Korea, Singapore, Hong Kong, Malaysia, Brazil, Switzerland, Thailand, Philippines, Australia, Indonesia, India, Israel, Saudi Arabia, Russia, Sweden, Argentina, Venezuela, Chile and Colombia.
  2. DTWEXM: Includes the Euro Area, Canada, Japan, United Kingdom, Switzerland, Australia, and Sweden.
  3. DTWEXO: Includes Mexico, China, Taiwan, Korea, Singapore, Hong Kong, Malaysia, Brazil, Thailand, Philippines, Indonesia, India, Israel, Saudi Arabia, Russia, Argentina, Venezuela, Chile and Colombia.

Additionally, they also publish the DEXINUS series that is the USDINR exchange rate.

These series go back to the mid-70’s and mid-90’s. However, India was a closed economy with a managed currency for the most parts. So for the rest of this post, we will consider data only from 2005 onward.

Here is how the time-series looks:
FRED DEXINUS-DTWEXB-DTWEXM-DTWEXO indices

Beta between USDINR and the rest

What we are interested in is the relationship between USDINR and the rest of the trade-weighted averages. DTWEXB and DTWEXO have India exposure with the latter made up predominantly of emerging markets. So we should expect a high beta between USDINR and those.

To calculate the beta, we will fit a linear model through USDINR and each of the trade-weighted indices in turn. Also, we will force the intercept to be zero to force the fit.

Here are the betas with a 20-day look-back:
20-day beta between USDINR and trade-weighted indices

Here are the betas with a 50-day look-back:
50-day beta between USDINR and trade-weighted indices

The 20-day chart shows that the beta oscillates within a tight band for the most part. This insight can be used to build a mean-reversion model for USDINR.

In Part II, we will explore the spread between USDINR and all three of the indices. Stay tuned!

Code and charts are on github.

Minimizing the role of luck in systematic trading

The following post is a replication of the Newfound Research article When Simplicity Met Fragility (pdf)

Thesis

Returns are function of both luck and skill. Even while applying systematic strategies like trend-following, momentum or value, there is always negative beta that sometimes overwhelms positive alpha. The article shows that “simple” strategies are often “fragile” because of the role of randomness (luck.) So it makes sense to combine different strategies within the same umbrella to make the investment process more robust. For example, there are more than a few dozen ways to implement a momentum strategy. Combining a few of them will result in a portfolio that is less exposed to luck.

Replication results

We used R to replicate the process described in the article on the S&P 500 index. We downloaded index values from Yahoo Finance and put through the same steps. Here is the single-strategy spread chart that uses 12-1 month momentum:

And this is the multi-strategy spread chart that combines three trend-following strategies including the one above:

As you can see, the multi-strategy chart is a lot less choppy that the single-strategy one. We will chalk this up as a successful replication of the original article.

The NIFTY 50 experience

Would the thesis hold when applied to the NIFTY 50 index?
Here is the single-strategy spread:

And here is the multi-strategy spread:

As you can see, the multi-strategy chart is a lot less choppy that the single-strategy one on the NIFTY 50 index as well.

Take-away

By combining different approaches under the same systematic strategy umbrella, investors can reduce the fragility of their overall portfolio and the influence of luck over the investment outcome.

This is something that we have been doing with our Themes right from the beginning. It just felt like common-sense back then. It is nice to see it in numbers.

Code and charts are on github.

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

This is the last part of the study. Part I, Part II

The reason why a linear model between NIFTY and USDINR built in Part II failed could have been because:

  1. Weekly returns were not appropriate for the relationship. Perhaps INR affects NIFTY at a higher frequency.
  2. There is no linear relationship because a rising/falling INR. Changes are not uniformly good/bad.

One way to visualize it is to plot the NIFTY returns density at different USDINR return thresholds. If there is no obvious difference in the densities between NIFTY returns when USDINR is positive vs. when it is negative, one could conclude that there is no straight forward relationship between the two.

Here is the NIFTY weekly returns density when USDINR is going up (the rupee is depreciating):
density plot NIFTY vs. USDINR
Note the curve when USDINR weekly returns are greater than 0.5% vs. when are greater than 2%. There is a bearish bias.

And, NIFTY weekly returns density when USDINR is going down (the rupee is appreciating):
density plot NIFTY vs. USDINR

If you juxtapose the above densities, it is apparent that when the rupee is appreciating, the densities skew right, And when the rupee is depreciating, there is a left skew. These charts show that there is “a” relationship – just not what can be captured by a linear model.

Code and density plots for NIFTY vs. OIL can be found on github.

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.