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'
Thiyaneswaran
@Thiyaneswaran
Best posts made by Thiyaneswaran
Latest posts made by Thiyaneswaran
-
RE: smart web socket only returns Ticks message: [{'ak': 'nk', 'msg': 'hb', 'task': 'hb'}]
-
Python Sdk websocket not working
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'}]
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: Read Timed out
@admin I am using python SDK ltpData() to get ltp even it in under your rate limit. i am getting data at starting then after few hours i am getting read timed out. My network connection is stable i am using other brokerage api also for me with them i am getting proper data.
-
RE: Read Timed out
@admin I am using python SDK getting read timed out error the above is the error i got. Please let me know what information do you need?
-
Read Timed out
Getting Read Timed out frequently
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Read timed out. (read timeout=7)
-
RE: How to get LTP using 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 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