Wednesday, October 10, 2012

Nifty flash crash analysis - part 2


When we look at the order book in real time, we get to see only top 5 buy and sell orders in the book. That is just the tip of the iceberg and one is left wondering how much of the iceberg is really below the surface. As it turns out, not much!

Thanks to the  flash crash, we just got a sneak peek below the surface.

Take a look at the plot below which depicts transacted value (in Cr) during 43rd minute plotted against the price drop during that minute. Click the image for more resolution.



Two things stand out:
1) As shown by the blue line, for the smaller transacted values, the drop is roughly proportional to the transacted value. Even in this range, the impact cost is already above 5%. Market simply cannot absorb more than 5 Cr worth of transaction in a single name nifty component.

2) There is a cluster of names around 20% drop. These are likely to be passive limit orders in the system where the buyer didn't really expect to be hit. Since emkay did not ask for trades to be reversed, that's one lucky and/or smart buyer.

I wonder what would have happened if there were limit buy orders at totally ridiculous prices. Maybe we could have seen the trades like Accenture trading at 1 cent which happened in US market flash crash on  May 6, 2010.

Note to self: Figure out how to automatically put in ridiculous buy orders every day at open. Chances of getting lucky are non-zero.

Update (11/Oct/2012):
In the post I speculated about smart/lucky guy having limit orders 20% below CMP. Today's Economic times story confirms that hypothesis.

How Inventure's client made a killing from Nifty's Friday crash
"He randomly puts many buy orders in stocks that are part of the Nifty at 20% below the market value. On Friday, this bet clicked."

Nifty flash crash analysis - part 1


Investing is an observational science  i.e. We cannot run controlled experiements and see what happens. Sometimes, a natural experiment takes place and we get to see some of the market mechanisms.

Nifty flash crash of October 5 offers just such an opportunity for a data driven investigation. For detailed analysis, we will have to wait till NSE releases the trade-by-trade data. In the meanwhile, we can look at the minute-by-minute data (available via Google Finance or vendors like Global datafeed) and make some conjectures.

From the story in the media, we know that a trader at Emkay Securities punched wrong orders that amounted to Rs 650 Cr sell orders hitting the market and thereby leading to flash crash.

From the minute-by-minute charts, it is clear that all hell broke loose in the 43rd minute. Let's piece together the minute-by-minute trading value for nifty components for the minutes leading up to the 43rd minute.

Minute, Approximated Traded Value (Cr)
40, 15.9
41, 19.5
42, 35.7
43, 610.8
44, 39.6
... Market halted

The minute data that we have roughly matches the news report value of 650 Cr of transactions happening in a small time window. Let's drill down into minute number 43.

We know that what emkay tried to execute was a Nifty basket sell order i.e. all the nifty components should be sold in proportion to their weight in Nifty. For example, Hindustan Lever which has 3.2% weight in the Nifty should have been sold approx 19.5 Cr (610 Cr basket order * 3.2%). And this is exactly what we find in the minute-by-minute data.

Here is a chart of expected traded value Vs actual traded value for the 43rd minute. (Click the image for higher resolution)


The blue line indicates the line where expected traded value is equal to actual traded value. This is the line on which the order book presumably had sufficient depth (obviously at atrocious impact cost – but that is the topic of next post).

The interesting part is to look at the outliers and speculate what could have caused them. For scrips below the blue line - such as ITC, HDFCBANK, RELIANCE, INFY, ICICIBANK - it is very likely that there was not enough depth in the limit buy order book at any price. In other words, order books were burned in the 43rd minute. 

What about scrips above blue line such as HDFC and LT which have transacted value above the ones predicted by our model? There must have been some other big traders in the market in the 43rd minute in these scrips apart from emkay. 

Bulk trade data corraborates this theory for HDFC. There was a bulk sale trade by Carlyle on October 5th


Bulk Deals Historical Data


Date Symbol Security Name Client Name Buy / Sell Quantity Traded Trade Price /
Wght. Avg.
Price
Remarks
05-Oct-2012 HDFC HDFC Ltd. CMP ASIA LIMITED SELL 430,00,000 761.08 -


Takeaways:

1) Indian markets hardly have any depth. It is surprising and worrying to see that a mere 15 Cr worth of sell order was sufficient to knock off 44,000 Cr of value from ITC's market cap for a few seconds. What if this happens in the last couple of minutes on F&O expiry date?

2) It is also interesting (well, not really!) to note that some players in the market were already aware of HDFC Carlyle trade happening and were positioned with buy orders.