One of the most unavoidable cost in trading is Slippage, it refers to the difference between the expected price of a trade and the price at which the trade is executed. Slippage occurs mostly with your market order, if a trader wants to avoid slippage completely he has to use limit order, but with limit order entry, there is a higher probability of missing a trade if market moves suddenly. So most of the traders has to live with this slippage cost, but only few traders who follow systematic approach will consider slippage when designing a system, if we fail to consider it in backtest, then once you go live with the system you will be in a rude shock when the trades are executed in live market.
First let us know what is impact cost/slippages?
Liquidity comes from the buyers and sellers in the market, who are constantly on the look out for buying and selling opportunities. Lack of liquidity translates into a high cost for buyers and sellers.
When a buyer or seller approaches the market with an intention to buy a particular stock, he can execute his buy order in the stock against such sell orders, which are already lying in the order book, and vice versa.
An example of an order book for a stock at a point in time is detailed below:
There are four buy and four sell orders lying in the order book. The difference between the best buy and the best sell orders (in this case, 0.50) is the bid-ask spread. If a person places an order to buy 100 shares, it would be matched against the best available sell order at 4 i.e. he would buy 100 shares for 4. If he places a sell order for 100 shares, it would be matched against the best available buy order at 3.50 i.e. the shares would be sold at 3.5.
Hence if a person buys 100 shares and sells them immediately, he is poorer by the bid-ask spread. This spread may be regarded as the transaction cost.
Progressing further, it may be observed that the bid-ask spread as specified above is valid for an order size of 100 shares. However for a larger order size the transaction cost would be quite different from the bid-ask spread.
Suppose a person wants to buy and then sell 3000 shares. The sell order will hit the following buy orders:
while the buy order will hit the following sell orders:
This implies an increased transaction cost for an order size of 3000 shares in comparison to the impact cost for order for 100 shares. The “bid-ask spread” therefore conveys transaction cost for a small trade.
This brings us to the concept of impact cost. We start by defining the ideal price as the average of the best bid and offer price, in the above example it is (3.5+4)/2, i.e. 3.75.
For example, in the above order book, a sell order for 4000 shares will be executed as follows:
The sale price for 4000 shares is 3.43, which is 8.53% worse than the ideal price of 3.75. Hence we say “The impact cost faced in buying 4000 shares is 8.53%”.
Impact cost is a practical and realistic measure of market liquidity; it is closer to the true cost of execution faced by a trader in comparison to the bid-ask spread.
There is no way to avoid slippages completely however we can reduce the slippages/impact cost by trading with high liquid stocks. But how do we find the most liquid stocks? Most people check the top volume gainers and consider that as high liquid. But this might not give us the true picture.
We have to follow the above impact cost method to know the slippage we may incur. Lets consider these two stocks Tata Metaliks Limited and SBI, as you can see in the market depth window, where SBI is more liquid because the difference between bid and offer is relatively smaller.
Say suppose, I want to buy SBI shares now at market order, currently it trades at 392.75, I want to invest Rs.5 lacs in it, total quantity I need to buy is 5 lacs/392.75= 1273 quantity. Most beginners think that it will get executed at 392.75 as that’s the last traded price. But when you send 1273 quantity of buy order at market price, how the real execution happens is the order matching mechanism at NSE exchange would check the order flow and executes it. As you can see 1150 quantity is available at 392.70, and another pending order of 1875 quantity is available.
So we wanted to buy 1273 quantity, where 1150 quantity will get executed at 392.70 and remaining quantity 123 gets executed at 392.75, so our average buy price is =((392.70*1150)+(392.75*123))/ 1273 = 392.705
Am able to easily buy 5 lacs worth of shares with SBI stock without much slippage/impact cost because its highly liquid.
Now if I have to buy the same 5 lacs worth of shares at market price with TATA METALINKS, this is how it gets executed, the pending order quantity at offer side is very low, where 10 quantity, 3 quantity are available compared to 1000s of quantity with SBI. At LTP of 762, if i have to buy 5 lacs worth of shares, I need to buy 5 lacs/762=656 quantity. So first
- 10 quantity will be filled at 762
- 2 quantity will be filled at 762.2
- 15 quantity will be filled at 762.25
- 6 quantity will be filled 762.45
- 1 quantity will be filled at 762.5
It goes on, even with all pending quantity shows in top 20 market depth window, we would be able to buy only 527 quantity worth around 4 lacs. So our actual average buy price is 763.05 where as ltp is 762. Our slippage here is 1.05 Rs.
If we compare this with above nse example, ideal price = buy price+sell price / 2, which is (761.25+762)/2=761.625, the first order in the market depth window.
Average buy price = 763.05, ideal price 761.625
Impact cost = (763.05–761.625) divided by 761.625 =0.19%
So any trader who traded with Tata Metalinks stock would have faced slippage of 0.19% for entry side alone and this would keep varying with all stocks based on the order flow.
Using Zerodha API data, we did impact cost analysis with all stocks to check what would be the list of stocks that would get executed easily with 5 lacs worth of orders with lesser slippages. These were the some of most liquid stocks with least impact cost, if I send market order to buy Asian Paints for 5 lacs, I would end up buying at 5 lacs ten rupees, this 10 rs is the impact cost, which is just 0.0021%
whereas if I send the same 5 lacs worth of orders to the below stocks, my impact cost is lot higher, as you can see to buy NHPC stocks, I end up spending additional 1356 Rs. as impact cost, where slippage is 0.27% for entry.
Slippages/impact cost varies based on the liquidity available in the market, higher the transaction value, larger the impact cost. By checking the market depth of any stock, we can clearly estimate what would be impact cost. By shortlisting stocks based on the above method can give you the list of most liquid stocks and trading them could reduce your overall slippages. You can download the top most liquid stocks list from here.