Can anyone please help with this . I am trying both socket 1.0 and 2.0 . The first one gives this message and the second one gives only print like :
In on pong function==> b'\x00'
In on pong function==> b'\x00'
In on pong function==> b'\x00'
In on pong function==> b'\x00'
In on pong function==> b'\x00'
In on pong function==> b'\x00'
morgancharlesw
@morgancharlesw
Best posts made by morgancharlesw
Latest posts made by morgancharlesw
-
RE: smart web socket only returns Ticks message: [{'ak': 'nk', 'msg': 'hb', 'task': 'hb'}]posted in Python SDK
-
Python Sdk websocket not workingposted in Python SDK
Hi Team,
I am using python sdk WebSocket streaming code to get live ticks but we are not getting ticks. Sharing the sample code let us know is there any mistake from our side if not check from your end. With the same code login is working fine and in streaming is not working properly.# package import statement from smartapi import SmartConnect from smartapi import SmartWebSocket #or from smartapi.smartConnect import SmartConnect import pyotp #import smartapi.smartExceptions(for smartExceptions) #create object of call obj=SmartConnect(api_key="r8psjpm9") #optional #access_token = "your access token", #refresh_token = "your refresh_token") #login api call data = obj.generateSession("T41918","****",pyotp.TOTP("****").now()) print(data) refreshToken= data['data']['refreshToken'] #fetch the feedtoken feedToken=obj.getfeedToken() #fetch User Profile userProfile= obj.getProfile(refreshToken) print(userProfile) #place order # feed_token=092017047 print(feedToken) FEED_TOKEN=feedToken CLIENT_CODE="T41918" # token="mcx_fo|224395" token="nse_fo|41665" #SAMPLE: nse_cm|2885&nse_cm|1594&nse_cm|11536&nse_cm|3045 # token="mcx_fo|226745&mcx_fo|220822&mcx_fo|227182&mcx_fo|221599" task="mw" # mw|sfi|dp ss = SmartWebSocket(FEED_TOKEN, CLIENT_CODE) def on_message(ws, message): print("Ticks: {}".format(message)) def on_open(ws): print("on open") ss.subscribe(task,token) def on_error(ws, error): print(error) def on_close(ws): print("Close") # Assign the callbacks. ss._on_open = on_open ss._on_message = on_message ss._on_error = on_error ss._on_close = on_close ss.connect() -
RE: smart web socket only returns Ticks message: [{'ak': 'nk', 'msg': 'hb', 'task': 'hb'}]posted in Python SDK
Hi , getting the same issue . Tried with both this old socket api and new socket 2.0 .Nothing works . No errors . Just this result . Any solution ?
-
RE: How to get LTP using python sdkposted in Python SDK
@admin Hi, Thanks for your quick response, Can you please share me sample other API call function which is not in documentation. and can you please me sample python (not SDK) login flow code
-
How to get LTP using python sdkposted in Python SDK
Hi Team,
There is no example in documentation to fetch ltp using python sdk. which function i need to call to get ltp for the given scrips