Getting yesterday's ticks in today's streaming data

Dear Kite team,

I have subscribed to streaming data from Kite, where I am getting per second ticks. Today, while running the code in production, I noticed that I received ticks from yesteday as well, which messed up the application. Please check the log extract below.

Can you please advise how to fix this issue?

[2021-02-12 03:40:26,839] {} INFO - Starting docker container from image aayushj18/tars
[2021-02-12 03:40:30,272] {} INFO - {"timestamp": "2021-02-12 03:40:30,271", "log_level": "INFO", "file": "", "function": "kite_stream", "lineno": 52, "thread": "MainThread","message": {"state":"started"}}
[2021-02-12 03:40:53,932] {} INFO - {"timestamp": "2021-02-12 03:40:53,930", "log_level": "INFO", "file": "", "function": "on_connect", "lineno": 56, "thread": "MainThread","message": {"type":"subscribe","instruments":[15495426,15495682]}}
[2021-02-12 03:40:54,159] {} INFO - {"timestamp": "2021-02-12 03:40:54,155", "log_level": "INFO", "file": "", "function": "on_ticks", "lineno": 68, "thread": "MainThread","message": {"type":"response","response_type":"tick","response":{"Instrument":"NIFTY21FEBFUT","InstrumentToken":15495682,"LastTradeTime":"2021-02-11T09:59:59","LastPrice":15184.95,"Volume":0.0}}}
[2021-02-12 03:40:54,159] {} INFO - {"timestamp": "2021-02-12 03:40:54,158", "log_level": "INFO", "file": "", "function": "create_stream", "lineno": 42, "thread": "MainThread","message": created stream: nifty21febfut_2021_02_12}
  • sujith
    Can you check what is the timezone of the machine?
    At what time did you try this out?
  • smathur
    Hi Sujith,
    We executed this code at market opening at 9:15 am IST. The machine is in Singapore timezone.
  • sujith
    sujith edited February 12
    We recommend setting the timezone to IST since the data received is binary and doesn't contain timezone information on pykiteconnect and date conversion happens on the local machine.
Sign In or Register to comment.