Websocket response structure

yoursvsr
Hi Team,

I have been going through the .Net client KiteConnect and noticed that the Ticker.OnTick delegate returns one Tick at a time per server response. Obviously this mandates that the response from the server is one quote packet per instrument subscribed, not one quote packet for all the instruments subscribed.

If it is so and if a websocket allows subscribing up to 3000 instruments in one go, and suppose I do subscribe to 3000 instruments, I'll be receiving 3000 quote packets per tick from the exchange / Zerodha.

Am I getting it right?
  • yoursvsr
    Mmm... upon close scrutiny, I have to admit I was wrong. The api returns response with all the quotes in one binary message. However, the KiteConnect client api provides interface for dealing with one Tick per instrument at a time.

    I wonder it would have been clear if a list of ticks received is returned. Anyways, thanks.
  • trade_then
    @yoursvsr
    returning of List rather than a single tick each time it is deciphered.
    would have resulted in running a loop over that list once again to do needful by the user.

    Other ways of parsing the tick binary can be implemented by the user if they understand the mechanism behind it. current implementation which is mimicking all other libraries especially the javascript one is such that it keeps on incrementing the offset.
    1. Line 196
    2. Line 186
    which makes it a serial operation and multi-threaded or tasked approach cannot be attempted with current logic.

    Sorry if comment seems unnecessary

    Thanks
    Regards


  • yoursvsr
    @trade_then, thanks for the comments.

    Yeah, exactly my thoughts too...

    Asynchronous tasking becomes all the more important when we try to build candles from the ticks and run strategies on them, all at the same time, and periodically too.

    I'm still exploring...

    Any and all comments are welcome.
Sign In or Register to comment.