certificate issue . unable to get token. please rectify issue asap
nahas_n
@nahas_n
Best posts made by nahas_n
Latest posts made by nahas_n
-
RE: unable to login - SSLError
-
RE: getting the next expiry dates
just save the dates ones for a year. and read the above from text file and compare with today date. and choose the near one. u only need to update once in a year.
-
Options data is not streaming today in websocket
hey today options not streaming with websocket. no problem with other stocks or future. please check from ur backend
-
NSE index feed NIFTY and BANKNIFTY along with other scrip
hey index (NIFTY and BANKNIFTY ) index feeding through websocket with a task of "mw"
nse_cm|26009 is for BankNifty.. nse_cm|26000 is for Nifty..
this is thing is super slow. i am getting tick with speed of 10 sec per tick. for index. no issues with stocks. any other way to get the index feed faster way ? . no documentation for streaming stock data along with index data. Any body solve this issue ?
-
RE: Error info: Connection to remote host was lost. Connection to remote host was lost.
@admin the problem still exists. i have log . i have took the count how many time it got disconnected . which is 42 time. please fix the problem as soon as possible.
-
RE: Error info: Connection to remote host was lost. Connection to remote host was lost.
from smartapi import SmartWebSocket import pickle from smartapi import SmartConnect from time import sleep from datetime import datetime as dt def get_feedtoken (): file = f'cache/ft_{dt.now().strftime("%d_%m_%Y")}.cache' token = pickle.load(open(file , 'rb') ) return [( k , v ) for k, v in token.items() ][0] def on_message(ws, message): global count , token , ts try: # print(message) for msg in message: ts['timestamp'] = msg['tvalue'] if 'tvalue' in msg.keys() else ts['timestamp'] msg['ltt'] = ts['timestamp'] if 'ltt' in msg.keys() and msg['ltt']=='NA' else msg['ltt'] if not 'tvalue' in msg.keys(): msg.update(ts) print(msg) except Exception as e: traceback.print_exc() exit() def on_open(ws): global task , token print("on open") ss.subscribe(task,token) print("subscribed") def on_error(ws, error): print(error) def on_close(ws): print("Close") CLIENT_CODE ,FEED_TOKEN = get_feedtoken () token="nse_cm|26009" task="mw" # mw|sfi|dp ts = {'timestamp' : None } ss = SmartWebSocket(FEED_TOKEN, CLIENT_CODE) ss._on_open = on_open ss._on_message = on_message ss._on_error = on_error ss._on_close = on_close while True: ss.connect()
some guys are dm me about to code. for handling about such scenario. this egs works fine. u need to reconnect again when it disconnected. no other options
-
RE: TOKEN WITH SYMBOL
@ankur12 try task as "mw" even if it is index. it will work along with other symbols
-
RE: websocket down ?
@admin the connection drop problem still exists that i have reported earlier. but i have managed to reconnect . please clear that from ur end.