Tag: quant

Market Cap Deciles

Introduction

Segmenting the market to track performance, risk etc. has been around for a long time. The Dow Jones Industrial Average was launched in 1896, the Sensex since 1986 and the Nifty since 1995. They provide a short-hand to gauge market performance and track returns over a period of time.

Index construction

An index can be constructed based on any combination of factors that are common to its constituents. They can be sectoral like FMCG, IT, etc. or they can be based on fundamental factors like book value, sales, etc. However, the most common way to construct an index remains free float market capitalization. This is the approach that most indices, like the Nifty, take.

The Nifty lists the following criteria for its constituents (NSE):

  1. Liquidity (Impact Cost)
  2. Float-Adjusted Market Capitalization
  3. Float
  4. Domicile
  5. Eligible Securities
  6. Other Variables

Deciles vs. Indices

Using existing indices come with some disadvantages:

  1. Rebalancing usually occurs once every 6 months – a lot can happen in that time.
  2. They usually have “other” considerations – not entirely quantitative.
  3. Do not cover the entire market – the biggest index in the NSE is CNX 500 that track 500 stocks.

An alternative is to build your own set of indices based on purely quantitative considerations. For example, you could divide the market into deciles based on their free float market cap and set a minimum daily turnover. This will then allow you to track micro-cap through mega-cap performance over arbitrary time frames, track how different stocks transition through deciles, set up “early warning” signals, etc.

Example

If you divide the market into deciles and set the minimum daily turnover to be 0.01% of float, then you end up with about 140 stocks in each. The 1st decile would be the micro-caps while the 10th would be the mega-caps. Here’s how the different deciles performed this week:

decile

Watch out for decile performance charts in our weekly and monthly performance roundups!

Backtesting a Pair Trading Strategy

A pairs trading strategy involves answering these questions:

  1. How do you identify “stocks that move together?”
  2. Should they be in the same industry?
  3. How far should they have to diverge before you enter the trade?
  4. When is a position unwound?

We saw how to answer the first two questions: understanding, defining, finding, and investigating pairs.

Trading strategy

We can start with a simple trading strategy: we buy the spread if it is one standard deviation below the average and sell the spread if its is one standard deviation above the average.

To keep things simple, we’ll ignore execution details like lot-size, actual $ p&l, etc… and focus on the viability of the strategy. We calculate p&l in terms of unit-spread, i.e., how many ‘spreads’ of p&l did the strategy create?

For BANKNIFTY vs. ICICIBANK, we simulated the strategy outlined above based on the daily close of the nearest to expiry futures from Jan-2010:

BANKNIFTY - ICICIBANK pair trade backtest 50 2010-01-01 long-short

The top chart is the the spread.
The 2nd is the trade: green implies the strategy went long the spread, red implies short.
The 3rd chart indicates the p&l of that specific trade (in spreads).
The last chart indicates the cumulative p&l (in spreads).
 
The p&l for this strategy over the entire time-period is +69.3189 spreads.

Asymmetric strategy

The idea behind the above strategy is to bet on mean-reversion on both sides. However, if you see closely, the shorts were not nearly as profitable as the longs. You could be better off just going long the spread whenever it hit one standard deviation and staying out of the market when the spread hit the upper band.

BANKNIFTY vs. ICICIBANK, long-only p&l +454.3036:

BANKNIFTY - ICICIBANK pair trade backtest 50 2010-01-01 long only

BANKNIFTY vs. HDFCBANK, long-only p&l +231.5225:

BANKNIFTY - HDFCBANK pair trade backtest 50 2010-01-01 long only

Conclusion

Some caveats:

  1. The signals are intermittent, but you need to keep running the algorithms everyday to capture the alpha. This requires an investment in systems on your part.
  2. The backtest ignores execution risk. For example, the hedge ratio is around 0.09830581 and there’s no way you can trade 1/10th of a contract. So your actual executable spread = 10 ICICIBANK – BANKNIFTY. That’s 11 contacts and it still doesn’t give you precision.

On the plus side:

  1. The backtest doesn’t do any risk management. This would’ve stop-loss’ed most of the bad trades.
  2. There is money to be made on the right pairs.

The Bank Nifty – ICICI Bank Pair

We defined the spread between a pair to be:

spread = A – βB

where A and B are prices and β is the first regression coefficient.

The β is also known as the hedge ratio.

Neither β, nor the relationship is “guaranteed” to be stable. Here are the p-values and β of Bank Nifty vs. ICICI Bank nearest to expiry futures, with a 50-day look-back:

BANKNIFTY - ICICIBANK p-value and beta 50

As you can see, the spread has periods of stability and adjustment. And sometimes, the stability is the anomaly.

To be continued…