It looks like you're new here. If you want to get involved, click one of these buttons!
# Initialise.
kws = WebSocket("vvv", "xxxxx", "DU0139")
print kws
kws.connect()
# Callback for tick reception.
def on_tick(tick, ws):
print tick
# Callback for successful connection.
def on_connect(ws):
# Subscribe to a list of instrument_tokens
print ws.subscribe([2561])
# Set ABAN to tick in `quote` mode.
print ws.set_mode(ws.MODE_QUOTE, [2561])
#print ws
# Assign the callbacks.
kws.on_tick = on_tick
kws.on_connect = on_connect
if kws.is_connected():
print kws.is_connected()
kws.close()
kws object is created and reports as
kws.connect()
after assigning callbacks.on_connect
callback. You might be getting heartbeat data inon_message
callback but we ignore it inon_tick
callback.Yup, I have tried subscribing to REIAGROLTD and ASHOKLEY.
Following is the source around that area. The symbol is hardcoded in debug mode, which is currently enabled
Guess I will be able to test it tomorrow!