The charts posted earlier makes more sense when seen along with the change in OI. Here are the updated charts:
To be continued…
Invest Without Emotions
The charts posted earlier makes more sense when seen along with the change in OI. Here are the updated charts:
To be continued…
A pairs trading strategy involves answering these questions:
We saw how to answer the first two questions: understanding, defining, finding, and investigating pairs.
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:
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.
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 vs. HDFCBANK, long-only p&l +231.5225:
Some caveats:
On the plus side:
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:
As you can see, the spread has periods of stability and adjustment. And sometimes, the stability is the anomaly.
To be continued…
When we discussed banks and introduced pair trading, we pointed out that a pairs trading strategy involves answering these questions:
Traders new to pair trading often mistake the correlation of prices to be indicative of “similarity”. For example, consider the Bank Nifty, HDFC Bank and ICICI bank. Here’s the chart of the closing price of the nearest to expiration futures contract:
And there are some really tight correlations:
BANKNIFTY | HDFCBANK | ICICIBANK | |
---|---|---|---|
BANKNIFTY | 1.0000000 | 0.7419966 | 0.9462238 |
HDFCBANK | 0.7419966 | 1.0000000 | 0.8327847 |
ICICIBANK | 0.9462238 | 0.8327847 | 1.0000000 |
However, this is only part of the story. What we need are pairs who’s price movements are mean reverting. Looking at price correlation alone is not enough.
We need the spread between pairs to be “stable”, i.e., mean reverting.
spread = A – βB
where A and B are prices and β is the first regression coefficient.
Here are the spreads between these pairs using 200-day data for regression:
Here are the spreads between these pairs using 50-day data for regression:
You don’t have to visually inspect spreads to see if they are mean-reverting. The most straightforward way of checking if a time-series is co-integrated is to perform a Dickey-Fuller test on it. If the p-value is less than 0.10, then this could be a good pair for trading.
N | Pair | p-value |
---|---|---|
300 | BANKNIFTY vs. ICICIBANK | 0.010000 |
300 | BANKNIFTY vs. HDFCBANK | 0.904480 |
300 | ICICIBANK vs. HDFCBANK | 0.407347 |
200 | BANKNIFTY vs. ICICIBANK | 0.010000 |
200 | BANKNIFTY vs. HDFCBANK | 0.472129 |
200 | ICICIBANK vs. HDFCBANK | 0.037115 |
100 | BANKNIFTY vs. ICICIBANK | 0.223806 |
100 | BANKNIFTY vs. HDFCBANK | 0.980776 |
100 | ICICIBANK vs. HDFCBANK | 0.670717 |
50 | BANKNIFTY vs. ICICIBANK | 0.429057 |
50 | BANKNIFTY vs. HDFCBANK | 0.405498 |
50 | ICICIBANK vs. HDFCBANK | 0.133357 |
30 | BANKNIFTY vs. ICICIBANK | 0.570427 |
30 | BANKNIFTY vs. HDFCBANK | 0.057717 |
30 | ICICIBANK vs. HDFCBANK | 0.370011 |
If you are trading futures, then a 200-day fit may not make much sense. The latest 30-day test between BANKNIFTY and HDFCBANK has a surprisingly low p-value of 0.057, indicating that there is a potential trade there.
To be continued…