How to perform operations on the data received from on_order_update

I saw this ,but have some questions:

I think I did not understood properly, how to do this. It will be really good, If someone can help. This is my code:

def on_ticks(ws, ticks):
# Callback to receive ticks.

def on_connect(ws, response):
# Callback on successful connect.
# Subscribe to a list of instrument_tokens (RELIANCE and ACC here).
print("Connection started")

# # Set RELIANCE to tick in `full` mode.
# ws.set_mode(ws.MODE_FULL, instrument_token)

def on_close(ws, code, reason):
# On connection close stop the main loop
# Reconnection will not happen after executing `ws.stop()`
print("Connected stopped")

# ws.stop()

def on_order_update(ws, data):
print("Okay got data")

# Assign the callbacks.
kws.on_ticks = on_ticks
kws.on_connect = on_connect
kws.on_close = on_close
kws.on_order_update = on_order_update

while True:
#Perform required data operation using tick data
def on_order_update(ws, ticks):

def helper_method(ticks):
print("Got tick, sleeping now")
#Assign callback

But I am getting this error:
Connection error: 1006 - connection was closed uncleanly (None)
Connection closed: 1006 - connection was closed uncleanly (None)
Sign In or Register to comment.