High amount of slippages recently

zuser
Hi, I have been placing orders via Kite Connect APIs for quite sometime. I calculate the expected price for the order quantity based on market depth I receive in websocket tick feed. I understand that slippages are likely for MARKET orders. Earlier I used to get 0.03% on an average(and 0.0% median) slippages. However, for last 3 weeks or so, the slippages have increased to 0.3-0.5% suddenly for almost 30-40% of the trades I place. The code is same and there is no additional network delay. Zerodha orderbook gives timestamp upto the level of seconds. I observe that orders are placed and executed in the same second.

Has anything changed in the tick feed snapshotting or order execution or something else? This sudden lag in the tick feed is handicapping me:( Even if I place LIMIT orders based on the price I see in the tick feed, significant of them would not be executed given the lag(/slippage) in the feed. (I tried with kite.quote api in place of tick feed and the slippages have remained the same. **0.3-0.5%** slippages for 30-40% of the trades is HUGE!)

If required, I can also share the order details with Zerodha team over emails.
  • RED
    Hi zuser, this happens when an algo does quote spoofing. As u deal with a much active stock in times of volatility there are big players spoofing the market depth and their latency is dealt in micro/nano seconds, where as being a retail individual latency drops to 1 or few seconds, which is not a match to vie.

    I suggest you modify the code accordingly, example split your qty in two parts and place a market and limit order simultaneously with a price difference to cover your brokerage atleast at times of loss.
  • kiteapi
    @zuser its amazing to see the level of detail to place orders (which I hope to get to in months or years, as I have just started with kiteconnect).

    Couple of questions:
    1. The scripts that you are trading, check if volume in bid/ask has dropped in the scrips you are trading in these recent months/weeks. This happened in late 2008 or early 2009, some stocks just did not have the volume like before 2008/2007, they just vanished and never returned. Which might be making your MARKET order hit the NBBO in market depth + but to get entire quantity it has to go to other/more depths too?

    2. From the time you look at market depth to order placement, do you see any tick which has taken up entire volume NBBO or just the NBBO has jumped up/down without an order fill? I guess then this would be @RED 's case of spoofing, then these algo's should be doing quote spoofing all the time in msec or lower.

    Please update once you figure out or analyze on what changed.
  • itsram90
    There are two ways I deal with it. For small quantity calculate depth on your side and place order on top, then code algo to chase and stay on top, it will get filled.

    If qty is large, calculate 1-3 min noise and distribute your orders in gaussian distribution
  • kiteapi
    @itsram90 to chase I feel there should be limit how much you can chase, because if confront the chase with another algo which tries to have the best prices and tries to get away, you dont want to chase too much and you get a very bad fill after chasing an another algo :) Like you said it is for small qty + I feel there should be a limit how much you chase, before that you just stop chasing, else the other algo can take you for a ride :)

    This is definitely an interesting topic, as a decent qty, will cause a lot of slippages getting the fill itself while entering and exiting.
  • itsram90
    Gaussian distribution of total qty over the range of market noise (relative to position duration) helps to hide large orders as well as fill position with better average price. only drawback is if trend is too strong only first leg will get executed and size of that would be <=25% . :smiley: its tricky
  • kiteapi
    @itsram90 I just took the API sub couple of weeks back, and had always wondered how it is done, Your shares here would help me when I get there when I need to worry about getting good fill, I can definitely consider what you shared here :)

    One query: To get the market noise for last 1-3 mins, means you need to constantly have the depth data and calculate the noise for the instruments that you want to trade in? So you subscribe to get the tick data using WebStreaming for these instruments, so you have the market noise data any moment you get the trade signal/trigger?
  • zuser
    @kiteapi
    1. The scripts that you are trading, check if volume in bid/ask has dropped in the scrips you are trading in these recent months/weeks. This happened in late 2008 or early 2009, some stocks just did not have the volume like before 2008/2007, they just vanished and never returned. Which might be making your MARKET order hit the NBBO in market depth + but to get entire quantity it has to go to other/more depths too?
    I will check the volume change in the stocks I have traded in last 3 weeks.
    2. From the time you look at market depth to order placement, do you see any tick which has taken up entire volume NBBO or just the NBBO has jumped up/down without an order fill? I guess then this would be @RED 's case of spoofing, then these algo's should be doing quote spoofing all the time in msec or lower.
    I process the tick and place the order before the next tick arrives. So I don't know before placing the order if market depth has changed :(

    I will update further findings here.
  • zuser
    zuser edited August 2020
    @itsram90
    Gaussian distribution of total qty over the range of market noise (relative to position duration) helps to hide large orders as well as fill position with better average price. only drawback is if trend is too strong only first leg will get executed and size of that would be less than 25% . its tricky
    I had experimented this earlier. 80% of the orders used to get filled when I replace market order by LIMIT order at the average expected price calculated from the market depth and wait for the quantity to get filled whole day. As you said, if the stock is trending and doesn't return back to the price again, the loss incurred by the 20% unfilled stocks was higher than the gain of trading 80%.
  • zuser
    Btw, do websocket feed and kite.quote return exactly the same data if kite.quote is called at the same time tick is received on the socket? (Empirically kite.quote returns before the next tick.) Do they refer to the same data buffer internally at zerodha/NSE end?

    @sujith
  • itsram90
    @zuser that's the beauty of Gaussian distribution i like. my tradings are limited to top tickers like nifty bank nifty , reliance sbi , usd inr etc these have amazing liquidity , i flip distribution 3 ways , noise is calculated for 3 min period, if momentum is too high, distribution becomes inverted, means high qty on both edges starting and ending
    when momentum is med , normal distribution, when its low i intend to make it square . this way your trades and their pnl becomes smoother, also you get most of your qty executed.
    worst case scenario, if trade goes against you, loss becomes much smaller than market orders.
    as liquidity is going down due to new rules and restrictions, this is the way to go
  • rakeshr
    @zuser
    Btw, do websocket feed and kite.quote return exactly the same data if kite.quote is called at the same time tick is received on the socket?
    Yes, Quote APIs use Websocket feeds as underlying data.
  • girish20099
    Hey, found this thread when reading on the the topic. I have also been experiencing severe slippage and delays in placing API orders lately (in general - not specifically for HFT).

    More detail on my forum post here -

    https://kite.trade/forum/discussion/8476/delay-in-executing-orders-via-api#latest

    Have people also been experiencing the same or has it resolved/they managed a resolution.
Sign In or Register to comment.