Kite connect : Web socket is not sending all the subscribed tokens.

WV1031
I had subscribed to 100 tokens but i dont receive all 100 every second.
At the 0th second of every minute i receive only 60-70 ticks out of 100.
This prevents me from creating 1 minute candles in my application.
Tagged:
  • WV1031
    WV1031 edited October 2019
    I am using the exact same code as provided in Java official client of kite connect.
    Also running on Main thread and not doing any operations in main thread.
  • ZI4453
    @WV1031 - can you confirm if you are getting ticks of all subscribed data(irrespective of time frame).usually tick will be broadcast ed whenever there is change in ticks.If you don receive any tick at all for an instrument then there are chances you might not have got subscribed to it.
  • WV1031
    WV1031 edited October 2019
    Its confirm that price were changing.. also it cannot happen that 30% of nifty 50 stocks dont move in 9:15 to 9:30am. And i am sure that all 100 tokens are subscribed at start.
  • WV1031
    WV1031 edited October 2019
    Is there a need to subscribe same thing multiple times?
  • WV1031
    WV1031 edited October 2019
    I want to know the LTP at 0th second of every minute of those 100 stocks. but if i dont get the data for 30% of them then I lose 30% candles for that minute. Because without open of candles , OHLC cannot be formed. So i lose 30% of opportunity , without my mistake.
  • ZI4453
    to be frank i have no clue how & why candle can really be used when you are dealing with numbers!

    anyways:-

    for candle data you should always carry over previous close as next interval open and if there is no change the value its understood "graph" is stagnant and value should be carried over subsequently to next time frame,when there is a "change", graph will move towards corresponding trend
    irrespective of time frame , we should take the last "updated value" of the stock as current value.You have timestamps , you can validate with that , if you still feel you need a confirmation you can try "GET QUOTE"
    try to align your codes for available data processing instead of expecting fresh data in stipulated time frame,though this is live market i would recommend you to consider "coding all exceptions" so your output will not be stuck when there is no fresh data
  • WV1031
    WV1031 edited October 2019
    Is this realtime https://kite.trade/docs/connect/v3/market-quotes/#retrieving-full-market-quotes
    What is the lag in creating OHLC data of previous minute , if there is some lag.
    Eg : If I want ohlc data for 1 minute span 11am to 11:01am , then after how many seconds post 11:01am , can i hit the #retrieving-full-market-quotes api to get the ohlc of last minute.
  • sujith
    It is the OHLC of the day that is published by the exchange.
    For live market strategies, you need to generate candles at your end. You can refer to this thread.
  • ZI4453
    @wv1031,
    socket streaming is live data and we should presume under ideal conditions that data(tick) is not lost.Broker server doesn't care if it has reached/received or processed from client End."its uni directional Broadcast only"Its upto the client to ensure received data is processed accordingly.

    GET quote is an API get call and i dont think you can keep pinging server for a quote due to Rate limits(also its not a Fair Usage of API).I believe with you wont require such a sensitive data until you are in FT.

    if you give more clarity on what exactly you are looking for(signal generation) we should be able to direct you in right approach.
  • WV1031
    WV1031 edited October 2019
    @sujith : Thank you for the thread link. It was really useful and exactly what i am trying to achieve.
    @ZI4453 : Thank you for the update.I am trying to build 1 minute candles for 100 instruments , using tick data received from websockets , so that i can apply various strategies on them i may find during backtesting.
Sign In or Register to comment.