Websockets streaming quotes stop after 1 to 2 mins automatically

Siddharthak
I have made a trial streaming script , but it stops after 1 to 2 mins of activity. Is this Normal behavior or I'm doing something wrong. I would also like to know how can I make it to stream quotes for longer period of times.

If it matters, I'm using Python Client and it serves almost a 100 ticks for the Instruments selected before stopping.
Tagged:
  • sujith
    Hi @Siddharthak,
    It is not normal, once you subscribe for 100 tokens, you keep getting ticks until you unsubscribe for it.
  • Siddharthak
    Siddharthak edited December 2016
    100 tokens?? I have only subscribed to about 50 tokens. Is this why the streaming is stopping automatically. The streaming stops because the process gets completed which should never happen as kite.connect () should be an infinite loop (as it says on the api website).

    And will it work if I increase my token subscription from 50 to 100 ? Do I have to subscribe to more than a 100 tokens for the streaming to continue forever ( or atleast during the trading hours)??
  • sujith
    Number of tokens you have subscribed for doesn't matter. You can even subscribe for one token.
    It will only stop when you are explicitly stopping it or it crashes. Try printing exception message and check.
  • Siddharthak
    Siddharthak edited December 2016
    "Process finished with exit code 0" this is what it says at the end . I get almost a 100 ticks before it stops.

    If you want i can give u a copy of my code.


    I did some searching for the issue on this forum and found this https://kite.trade/forum/discussion/822/kws-connect-not-working

    It sounds quite like what I'm facing but i get bout a 100 ticks before getting disconnected and the code after kite.connect() gets executed which should not happen as kite.connect is an infinite loop.

    I hope this gives you an insight into my problem.
  • sujith
    Can you paste your code in a gist and send link?
  • Siddharthak
    Siddharthak edited December 2016
    You can look at the code at https://gist.github.com/anonymous/4c2d37bbde3baa86bda4843b6f8f0b6f


    Its almost a copy of the kite webinar script I saw on YouTube .
  • Vivek
    @Siddharthak Can you please enable logging and check if the error is getting logged while exiting. You should do something like this - https://gist.github.com/vividvilla/a1e649e70ab00a8f00ab5c303e3db2fb
  • Siddharthak
    I copied it and ran it. It stopped again after a few minutes. Coz the market is not open right now so I just got one tick while it ran. Log file was created but it was empty with nothing in it. I'll run it again in the morning when the markets open up to see if that changes anything.
Sign In or Register to comment.