Author: shyam

Practical Momentum, Part I

Introduction

Momentum effects are one of the premier anomalies in the market and we have been running an equity long-only momentum strategy since 2013 with returns of +64.44% vs. Nifty’s +27.25% so far. Given the success of long-only equity momentum, we were curious as to how a long-short version of it would perform in India given our unique constraints. And also investigate if its success could be replicated using derivatives.

Typically, academic research that discuss momentum tide over the difficulty involved in shorting stocks. In India, you can only short stocks through SLBS in quantities that are multiples of the lot-size. And only those stocks that are allowed in the F&O segment can be borrowed for selling short. In order to overcome these constraints, we restricted our universe of stocks to only those that have been in the F&O segment since Jan 2004. There are grand total of 97 stocks that fit this criteria.

The biggest problem with choosing such a restricted universe is survivorship bias. One can argue that the stocks that survived from 2004 through 2015 and had enough liquidity to be listed in F&O would have stronger long-term momentum than those that do not. If this is true, then it doesn’t make sense going short. We will see if this hypothesis is confirmed in our back-test.

Long-only Momentum

Typically, momentum strategies are run using a one-year look-back period. We wanted to check what kind of impact shorter look-back periods had on overall returns. The following results are for going long (equally weighted) the top 5 stocks in our universe at the beginning of every month and holding it for one month.

The red line is the one-year look-back momentum; black is 100-day look-back momentum; and green is buy & hold Nifty
long-only-momentum.2005-2010

long-only-momentum.2011-2014

By year:

long-only-momentum

Long-short Momentum

You would think that shorting “weak” stocks should give returns comparable to going long “strong” stocks. But that doesn’t seem to be the case. The short-portfolio was always a drag on performance and made returns more volatile.

long-short-momentum.2005-2010

long-short-momentum.2011-2014

Conclusion

A long-only momentum strategy with a one-year look-back beat the pants out of both the Nifty and the long-short strategy. This could be because the pool of stocks in F&O show strong survivorship bias. We will continue to investigate if the short portfolio can be made more efficient. Stay tuned!

Weekly Recap: Holacracy

world.2015-04-30.2015-05-08

Equities

Major
DAX(DEU) +2.23%
CAC(FRA) +0.87%
UKX(GBR) +1.24%
NKY(JPN) -0.39%
SPX(USA) +1.47%
MINTs
JCI(IDN) +1.88%
INMEX(MEX) +1.62%
NGSEINDX(NGA) -0.92%
XU030(TUR) +0.33%
BRICS
IBOV(BRA) +1.64%
SHCOMP(CHN) -5.31%
NIFTY(IND) +0.12%
INDEXCF(RUS) +1.20%
TOP40(ZAF) -0.99%

Commodities

Energy
Heating Oil -0.83%
Natural Gas +5.22%
Brent Crude Oil -1.76%
WTI Crude Oil -0.18%
Ethanol +1.91%
RBOB Gasoline -2.24%
Metals
Platinum -0.08%
Copper +1.04%
Palladium +2.72%
Gold 100oz +0.38%
Silver 5000oz +1.86%

Currencies

USDEUR:+0.01% USDJPY:+0.13%

MINTs
USDIDR(IDN) +1.15%
USDMXN(MEX) -1.55%
USDNGN(NGA) +0.16%
USDTRY(TUR) +0.78%
BRICS
USDBRL(BRA) -1.32%
USDCNY(CHN) +0.10%
USDINR(IND) +0.81%
USDRUB(RUS) -1.29%
USDZAR(ZAF) +0.10%
Agricultural
White Sugar +1.17%
Coffee (Robusta) -2.17%
Corn -0.83%
Feeder Cattle -0.72%
Soybean Meal -1.53%
Soybeans +0.36%
Sugar #11 +1.22%
Wheat -0.21%
Cattle -5.08%
Cotton -2.85%
Lean Hogs +5.52%
Lumber -7.84%
Orange Juice +1.21%
Cocoa -0.45%
Coffee (Arabica) -3.79%

Credit Indices

Index Change
Markit CDX EM -0.03%
Markit CDX NA HY -0.59%
Markit CDX NA IG +2.67%
Markit iTraxx Asia ex-Japan IG -0.22%
Markit iTraxx Australia +0.48%
Markit iTraxx Europe +1.76%
Markit iTraxx Europe Crossover +10.94%
Markit iTraxx Japan +2.28%
Markit iTraxx SovX Western Europe -0.21%
Markit LCDX (Loan CDS) +0.00%
Markit MCDX (Municipal CDS) +0.35%
Can you believe that after all the drama, the NIFTY actually ended this week in the green?

Nifty Heatmap

CNX NIFTY.2015-04-30.2015-05-08

Index Returns

For a deeper dive into indices, check out our weekly Index Update.
index performance.2015-04-30.2015-05-08

Sector Performance

sector performance.2015-04-30.2015-05-08

Advance Decline

advance.decline.line2.2015-04-30.2015-05-08

Market Cap Decile Performance

Decile Mkt. Cap. Adv/Decl
1 (micro) -3.91% 60/69
2 -6.40% 64/64
3 -3.74% 63/65
4 -2.57% 58/70
5 -3.22% 55/73
6 -3.93% 54/74
7 -3.29% 56/72
8 -2.15% 64/63
9 -3.23% 57/71
10 (mega) -2.96% 66/63
Outside the NIFTY, things looked bad across the board…

Top Winners and Losers

HINDALCO +8.05%
BAJAJ-AUTO +8.95%
ABIRLANUVO +19.35%
SRTRANSFIN -18.54%
BANKBARODA -14.14%
EXIDEIND -10.61%
Nuvo rallied on retail merger plans…

ETF Performance

CPSEETF +0.42%
NIFTYBEES -0.14%
GOLDBEES -0.81%
INFRABEES -1.51%
JUNIORBEES -2.32%
BANKBEES -3.84%
PSUBNKBEES -4.45%
PSU banks got shellacked…

Yield Curve

yield Curve.2015-04-30.2015-05-08

Bond Indices

Sub Index Change in YTM Total Return(%)
GSEC TB -1.07 +0.50%
GSEC SUB 1-3 -0.77 +1.81%
GSEC SUB 3-8 -0.63 +2.30%
GSEC SUB 8 -0.28 +2.63%
Coupons kept the dream alive…

Investment Theme Performance

Equity Mutual Funds

Bond Mutual Funds

Thought for the weekend

Zappos, an online shoe retailer, announced that the company was eliminating managers and attempting to make Zappos “a fully self-organized, self-managed organization by combining a variety of different tools and processes.” The move to self organize involves the adoption of Holacracy, a system of governance that emphasizes the distribution of authority.

Subsequently, about 14% of the company’s workforce, or 210 out of 1,503 employees, quit.

Source: Zappos Watches 210 Employees Self-Manage Themselves Out The Door

Machine Learning Long-Short Trend Following

Introduction

Our previous post discussed how a simple SMA On/Off Switch based tactical algo can be enhanced by a volatility metric. We generated significant alpha by following a simple rule:

Go short if either or the volatility signal or the 50-DMA indicates a negative bias and long otherwise.

But what if we trained a machine on the same data and allowed it to decide when to go long and short?

Support Vector Machines

We fed an SVM our volatility metric and the percentage distance from 50-day SMA. A 5-year training set was used to predict the next year daily long/short. We will not delve into the details of how SVMs work, Wikipedia does a decent job introducing the concept.

Performance

To make it easier to compare, we plot the wealth-charts for the NIFTY and BANKNIFTY indices side-by-side.

The black line is the Machine Learning Long-Short Model and the blue line is buy-and-hold. NIFTY and BANKNIFTY since 2011:

nifty.machine.learning.2011

banknifty.machine.learning.2011

NIFTY and BANKNIFTY since 2013:

nifty.machine.learning.2013

banknifty.machine.learning.2013

Cumulative Returns

Buy-and-hold has two big advantages over a trading strategy: transaction costs and tax treatment. Here is how the different strategies compare with buy and hold:

NIFTY SVM

BANKNIFTY SVM

It appears that the ML(V + 50-DMA) Long Short strategy works better on the BankNifty than on the Nifty. The out-performance of the ML model on the BankNifty more than compensates for transaction costs and taxation.

Conclusion

The ML model outperformed the NIFTY by an average of 12% in the last 4-years and the BANKNIFTY by 94% in the same period. The out-performance on the BANKNIFTY is considerable enough to warrant further exploration.

Basis Trades using Futures

Introduction

When we discussed cash-futures basis, it was pointed out that the fair value of a futures contract is a function of the underlying price, interest rates, dividends and time to expiration. The same logic applies to the fair value of contracts across expiration dates. For example, as of close on April 30, 2015, NIFTY futures contracts had the following values: 8177.35 (April), 8244.05 (May), 8275.30 (June).

Some of our clients wanted us to check if this basis can be traded. Is it possible to profit from going long the near contract and short the far contract on a consistent basis? Before we look at profitability, lets chart the basis.

The basis

Here is how the basis between different contracts look (2000 through now):

NIFTY.futures.basis

Here is the summary statistic of the basis:

summary statistics

Here is the same data with futures expiry dates removed:

summary statistics

With the extreme values removed, we can now check if we can trade the nearest expiry contract with the farthest.

50-day Average Basis Trade Back-Test

Lets take a look at the Near vs. Farthest basis and draw a 50-dma through it:

NIFTY.futures.basis.50dma

The basis is not stable and what’s worse, it appears to be trending. Lets try our simple trading rule: go long the basis if it is above 50-dma and short if otherwise.

Here’s how the back-test works out (2005 through now):

NIFTY.futures.basis.50dma.trade.2005

Lets check the back-test on a smaller subset (2010 through now):

NIFTY.futures.basis.50dma.trade.2010

A ~20% profit in a 10 year time-frame is barely enough to cover transaction costs. Besides, it looks like the strategy hit a wall in 2010.

Conclusion

It appears that the basis trade described above is not profitable enough after considering transaction costs and taxes. Also, whatever meager profits were there seem to have been arbitraged away lately.

Is there a correlation between USDINR and Tech stocks?

tl;dr

No.

The Myth

Regular viewers of CNBC might have heard the refrain that “IT stocks went up because the rupee went down.” But it turns out that it is the classic case of the journalist/reporter/anchor going in search of a reason to explain a random market event. If there is such a correlation, then a scatter plot of USDINR returns vs. CNX IT index returns should unearth it.

Scatter Plots of Returns

Weekly:
CNX IT.USDINR.scatter.weekly

Daily:
CNX IT.USDINR.scatter.daily

As you can see, there is no obvious link between USDINR and technology stocks. But what if the effect manifests after a lag?

Cross-Correlation Plots of Returns with Lag

Weekly:
CNX IT.USDINR.ccf.weekly

Daily:
CNX IT.USDINR.ccf.daily

Conclusion

Currency moves alone cannot be your go-to explanation for fluctuations in tech stocks.