Ensuring seamless tick data throughout a day

Duke2sky
Pl can someone tell me how should I ensure that the web socket gives me seamless data of ticks throughout a day. However at present it stops after 15 seconds or so.
I have also followed discussions in the forums and have threaded def on_ticks using kite.connect(threaded= True)
  • rakeshr
    If you are having heavy computation, you need to use solution 1, mentioned here, using Queue manager.
  • Duke2sky
    ok, will try this and post the results
  • AlgoTraderXYZ
    @rakeshr - The solution 2 you have proposed in the other thread. That is using threaded=True and a while True loop in the main thread. Will that not generate hundreds of copies of on_ticks and helper_method functions every second as it continuously loops? How can it be advisable to implement such an approach?
  • rakeshr
    rakeshr edited July 2022
    Will that not generate hundreds of copies of on_ticks and helper_method functions every second as it continuously loops?
    Yes, it will but it will be handled by the Python memory manager. It was a pseudo-code to illustrate the use of daemon thread, generated post setting threading=True for the main ticker instance.
    Daemon threads of python threading are dependent on the main thread running, so we will have to block the main thread in some way to keep using the daemon threads, so here is the while loop.
    PS: You seem to have replied on multiple threads with the same query. We have removed all your duplicate responses.
This discussion has been closed.