Hi @admin,
I am also getting the same msg "In on pong function==> b'ping'".
Any reason why I am not able to fetch data ?
Best posts made by azkhan
Latest posts made by azkhan
-
RE: User Feedback - WebSocket 2.0 Beta Rollout – Python Language
-
RE: Python Streaming Tick Data Problem with SmartAPI Websocket's
@adi3399
For more Info on websocket go to this link : https://smartapi.angelbroking.com/docs/WebSocketStreaming -
RE: Python Streaming Tick Data Problem with SmartAPI Websocket's
@adi3399
Go to this link to find the token information of all tradable instruments : https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.jsonThen Use this code to get live data streaming for any stock or Index
Getting started with SmartAPI Websocket's :from smartapi import SmartConnect
from smartapi import SmartWebSocketLive_Data_API = " Enter Your API Key Here"
Username = "Enter Your Angel Broking User name"
Password = "Enter Your Angel Broking Password"
#create object of call
obj=SmartConnect(api_key=Live_Data_API)#login api call
data = obj.generateSession(Username,Password)
refreshToken= data['data']['refreshToken']#fetch the feedtoken
feedToken=obj.getfeedToken()#fetch User Profile
userProfile= obj.getProfile(refreshToken)feed_token=092017047
FEED_TOKEN=feedToken
CLIENT_CODE=Usernametoken="mcx_fo|224395"
token="EXCHANGE|TOKEN_SYMBOL" #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_closess.connect()
-
RE: Open interest in websocket
@admin when is the next major release of smart-API which include OI data ?
-
RE: Open interest in websocket
@admin Can you provide any tentative dates when you guys are going to add OI data in web socket streaming.
-
RE: Python Streaming Tick Data Problem with SmartAPI Websocket's
@adi3399 please update your SmartAPI Python library.