We can subscribe for up to 1000 instruments on a single WebSocket connection and we can open 3 WebSocket connection. Does this mean we can able to subscribe 3000 instruments?
I need more than one connection. So that I can watch instruments in groups. Basically, I need more than one callback to perform different action for different groups.
You can maintain multiple lists of instruments with categories at your end and from the on_ticks callback, you can keep receiving ticks. You need to write a wrapper to separate and write to the corresponding list.
@sujith: One connection means 1000 instruments. And you made a comment that Zerodha plans to limit each api key to one connection only. If someone wants to subscribe to more than 1000 instruments. This can easily happen if I track all the futures for current, near term plus far term plus if I subscribe to the top 500 instruments in the NSE.
@sujith Please dont reduce the number of connections. I spare connection is always needed to handle exceptions and background checks. Such restrictions will make kite connect a complete NO NO for developers.
@sujith whats the status of this now ? Can we still use 3 websockets with one key or not ? And is the max limit of instruments per connection still 1000 ?
kws1 = WebSocket(...)
kws1.on_tick = on_tick_group1
kws2 = WebSocket(...)
kws2.on_tick = on_tick_group2
If you restrict one connection per api_key, My program will not work. Please let me know if you have alternative ideas to implement my logic.
You need to write a wrapper to separate and write to the corresponding list.
If someone wants to subscribe to more than 1000 instruments. This can easily happen if I track all the futures for current, near term plus far term plus if I subscribe to the top 500 instruments in the NSE.