OnZerodhaTicker

Saleem
There are currently around 10+ lac instruments available under the list of instruments.

1. Do all the instruments' ticks show up in OnZerodhaTicker, when I subscribe to ticks from all the instruments with the ticker?
Is there a restriction on number of instruments added to a ticker to get the ticks?

2. I have a winform .NET exe which registers gets the ticks with the values. Initially, it works well, but after sometime, say 3-4 hours after the login, the ticks stop working, I have to close and start the exe again. Is there an issue with my code or some setting needed?

ticker1 = new Ticker(MyAPIKey_Zerodha, MyAccessToken);

ticker1.OnTick += OnZerodhaTicker;
ticker1.OnReconnect += OnReconnect;
ticker1.OnNoReconnect += OnNoReconnect;
ticker1.OnError += OnError;
ticker1.OnClose += OnClose;
ticker1.OnConnect += OnConnect;
ticker1.OnOrderUpdate += OnOrderUpdate;

ticker1.EnableReconnect(Interval: 5, Retries: 500);
ticker1.Connect();

ticker1.Subscribe(listOfInstruments.ToArray());
ticker1.SetMode(listOfInstruments.ToArray(), Mode: KiteConnect.Constants.TickerMode.Full);
  • nagavenij
    1. Instrument Subscription Limits

    You cannot subscribe to all 10+ lakh instruments through a single WebSocket connection. Kite Connect enforces a limit of 3,000 instrument tokens per WebSocket connection. Please refer to the Kite Connect documentation.

    If you need to monitor more than 3,000 instruments, you will need to distribute them across multiple WebSocket connections, subject to the applicable connection limits.

    Trying to stream too many instruments will saturate your network bandwidth and cause processing choke on your machine.

    2. Ticks stop arriving after 3–4 hours

    The issue could be related to the application's handling of the WebSocket connection or incoming tick data.

    Possible causes include:

    - The application may stop processing incoming ticks due to an exception, blocking operation, or another issue in the tick-handling logic.

    - The WebSocket connection may have been interrupted due to a network issue or another connection-level event.

    - The application may not have successfully reconnected after the connection was interrupted, despite automatic reconnection being enabled.

    - The application may not be maintaining or restoring the required subscriptions after a reconnection.

    - Resource usage, network instability, or other environmental factors may affect the application's ability to maintain the connection or process incoming data.

    Since restarting the application restores the ticks, we recommend checking the application's WebSocket connection/reconnection handling and tick-processing logic to identify and address the underlying cause.
Sign In or Register to comment.