Live Stream Data every minute

beast123
I am using websockets to stream live data . But I need to get only after 1 minute . It is giving the data every second . I have to make some changes to the code . Please Help

from kiteconnect import WebSocket

#print(WebSocket)
# Initialise.

kws = WebSocket("xxxxx", "yyyyyy", "zzzzzz")



# Callback for tick reception.
def on_tick(tick, ws):
print (tick[0]["ohlc"])
print (tick[0]["volume"])

# Callback for successful connection.
def on_connect(ws):
# Subscribe to a list of instrument_tokens (RELIANCE and ACC here).
ws.subscribe([738561])
ws.set_mode(ws.MODE_FULL, [738561])

# Assign the callbacks.

kws.on_tick = on_tick
kws.on_connect = on_connect
#kws.close()


# Infinite loop on the main thread. Nothing after this will run.
# You have to use the pre-defined callbacks to manage subscriptions.

kws.connect()
Sign In or Register to comment.