Websocket Data Issue


  • Hello,

    Is the below code correct? As I am not getting tick data for SBI.
    Can someone help?

    token="mcx_fo|224395"
    token="nse_cm|3045" #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(feedToken, clientId)

    def on_message(ws, message):
    print("Ticks: {}".format(message))
    print(message)
    def on_open(ws,response):
    print("on open")
    ws.subscribe(task,token)

    def on_error(ws, error):
    print(error)

    def on_close(ws):
    print("Close")
    ws.stop()

    ss._on_open = on_open
    ss._on_message = on_message
    ss._on_error = on_error
    ss._on_close = on_close

    ss.connect()

    Output is below:

    [{'name': 'tm', 'tvalue': '02/07/2021 20:03:04'}]
    Ticks: [{'name': 'tm', 'tvalue': '02/07/2021 20:03:05'}]
    [{'name': 'tm', 'tvalue': '02/07/2021 20:03:05'}]
    Ticks: [{'name': 'tm', 'tvalue': '02/07/2021 20:03:06'}]
    [{'name': 'tm', 'tvalue': '02/07/2021 20:03:06'}]


  • @admin when can we expect this to be fixed?

    Also in the documentation, wss root api is given as

    'wss://omnefeeds.angelbroking.com/NestHtml5Mobile/socket/stream'

    but in python module, it is given as:
    'wss://wsfeeds.angelbroking.com/NestHtml5Mobile/socket/stream'

    which one of these is correct ( or better ). None of them is working at the moment though. Both are returning only "tm" feed


  • HI @parth3737 As posted on another thread our team is working on web socket.