Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Websocket Data Issue

    Python SDK
    3
    3
    58
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      parth3737 last edited by

      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'}]

      A 1 Reply Last reply Reply Quote 0
      • A
        admin @parth3737 last edited by

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

        P 1 Reply Last reply Reply Quote 0
        • P
          pranav @admin last edited by

          @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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post