It looks like you're new here. If you want to get involved, click one of these buttons!
susbcription_list = [int(x) for x in trd_portfolio]
def getticks(ticks):
for tick in ticks:
ticks_token = tick['instrument_token']
push_tick_values_to_trd_portfolio(tick, ticks_token)
push_value_to_excel()
def on_ticks(ws, ticks):
# Todo: "On_ticks"
getticks(ticks)
def on_connect(ws, response):
ws.subscribe(susbcription_list)
ws.set_mode(ws.MODE_FULL, susbcription_list)
# Assign the callbacks.
kws.on_ticks = on_ticks
kws.on_connect = on_connect
kws.connect(threaded=True)
count = 0
while True:
count += 1
if count % 2 == 0:
if kws.is_connected():
kws.set_mode(kws.MODE_FULL, susbcription_list)
else:
if kws.is_connected():
kws.set_mode(kws.MODE_FULL, susbcription_list)
time.sleep(5)