While am able to get real time tick data with on_connect, I need the data once in lets say 1 minute or 5 minutes, I understand I can get continuous tick data and then convert them in 1 min or 5 min data, but rather I was wondering if I could just connect and get the data once a min or in 5 mins (as OI is updated once in a min or 5 mins). I assumed that on_close would close the connection after one (1) tick, but I see no difference and see continuous tick data with or without on_close.
Here is what I have tried:
1. I tried adding sleep inside on_ticks - but it does not work with even 5 sec sleep, as TCP connection gets closed and throws the error:
Connection error: 1006 - connection was closed uncleanly (None) Connection closed: 1006 - connection was closed uncleanly (None)
2. I can use kite.quote as I need data for once in 1 min, but I found that tick data is faster (am sure that is why dev support from Zerodha suggest to use that) and can get data for 80 (I know you support 3000 per user, my req is not that much yet) instruments in 1 second, whereas same would take around 40 seconds with kite.quote.