I have been using your API since last three years. Things were working fine since till last friday. Since today morning Kiteticket seems to be not threading (Not working). KiteConnect appears to be fine. This is urgent could someone please help.
Since today morning Kiteticket seems to be not threading (Not working)
Everything is fine at our end for kiteconnect ticker/websocket stream. Just tried, an threaded example, and it's working fine. Can you paste here the complete error stack trace/log?
#function to read symbols from dStream portfolio def read_excel(): for x in range (3,1305): name = sht.range('A'+str(x)).value if name == None: break token = sht.range('E' + str(x)).value subscribe.append(token) trd_portfolio[token] = {"name":name, "row":x}
subscribe =[]
trd_portfolio = {}
sht = wb.sheets['dStream2']
mode = 'MODE_QUOTE'
#function to read symbols from dStream portfolio
def read_excel():
for x in range (3,1305):
name = sht.range('A'+str(x)).value
if name == None:
break
token = sht.range('E' + str(x)).value
subscribe.append(token)
trd_portfolio[token] = {"name":name, "row":x}
read_excel()
def on_ticks(ws, ticks):
print('yell')
feed_ltp(ticks)
print("1 Cycle Completed at ", datetime.datetime.now())
logging.info("Ticks: {}".format(ticks))
#order_place()
def on_connect(ws, response):
ws.subscribe(subscribe)
ws.set_mode(ws.MODE_QUOTE, subscribe)
def on_close(ws, code, reason):
ws.stop()
def feed_ltp(ticks):
#wb.sheets['OHLC'].range('B1:P2000').value = None
df_ltp_df1 = pd.DataFrame(ticks)
df_ohlc = pd.DataFrame(columns=['open','high','low','close'])
for(i5,r5) in df_ltp_df1.iterrows():
e=r5['ohlc']
df_ohlc.loc[i5] = [e['open'],e['high'],e['low'],e['close']]
df_ltp_df1 = pd.concat([df_ltp_df1,df_ohlc], axis=1)
df_ltp_df1.drop('ohlc',axis=1,inplace=True)
df_ltp_df1 = df_ltp_df1.sort_values(by=['instrument_token'])
wb.sheets['OHLC'].range('B1').value = df_ltp_df1
#input("Press enter")
order_place()
#time.sleep(3)
print('ji')
print('pi')
kws.on_ticks = on_ticks
kws.on_connect = on_connect
kws.on_close = on_close
kws.connect()
The output is as below
Press Enter to Continue
ji
pi
Connection error: 0 - error parsing request
Connection error: 0 - error parsing request.
no progress from there
ERROR:kiteconnect.ticker:Connection error: 0 - error parsing request
ERROR:kiteconnect.ticker:Connection error: 0 - error parsing request.
since today , while fetching the instrument code from Kite connect the return value is a float and not an integer.
try converting the instrument code to int and then run your code. hope it should work.