Navigation

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

    WebSocket streaming did not work the whole day today. However, I'm able to fetch LTP data using ltpData method. Was something wrong with streaming today?

    Python SDK
    0
    12
    177
    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
      projectSB last edited by

      I still use the websocket streaming in the following manner:

      from smartapi import SmartWebSocket
      from smartapi import SmartConnect
      import pyotp

      ss = SmartWebSocket(FEED_TOKEN, CLIENT_ID)

      def on_message(ws, message):
      <code>
      
      def on_open(ws):
          print("Connection opened")
          ss.subscribe(TASK, TOKEN)
          logger.info("Connection opened, subscriptions done")
      
      
      def on_error(ws, error):
          global EXIT_ALL
          #print("Inside error code")
          logger.info(error)
          str_Errors = traceback.format_exc()
      
      def on_close(ws):
          print("Connection Closed")
          logger.info("Connection closed")
      
      # Assign the callbacks.
      t2 = threading.Thread(target=trade_Execution)
      t2.start()
      
      ss._on_open = on_open
      ss._on_message = on_message
      ss._on_error = on_error
      ss._on_close = on_close
      ss.connect()
      

      is this version of websocket outdated etc?

      punit 1 Reply Last reply Reply Quote 0
      • punit
        punit @projectSB last edited by

        @projectSB Yes, AB have switched off V1 without any notice.

        P N 2 Replies Last reply Reply Quote 0
        • P
          projectSB @punit last edited by projectSB

          @Ashok That's not fair. At least there should be a general notification etc.
          Any way, what do I need to do to get migrated to V2? are there code level changes required?
          or is it just the modules that needs to be updated?

          @admin - Please need your assistance here. As per other posts, the V2 is still having issues right?
          So why switch off the V1 till everything is resolved in V2?

          punit 1 Reply Last reply Reply Quote 0
          • punit
            punit @projectSB last edited by

            @projectSB I am exactly on the same boat/equally mad as an user. The formal release/support structure is not working anymore with smart API.

            I think the V2 migration is in line with angelone migration and underlying API's. Thought V2 is not prefect, it does works and I am trading using it for couple of days. OM me for more details of the document below is not clear.

            https://smartapi.angelbroking.com/docs/WebSocket2

            Regards
            Ashok.

            T P 2 Replies Last reply Reply Quote 0
            • T
              techsharad @punit last edited by

              @Ashok said in WebSocket streaming did not work the whole day today. However, I'm able to fetch LTP data using ltpData method. Was something wrong with streaming today?:

              trading

              hey @Ashok can you help me out to migrate v2 with Java SDK.

              punit 1 Reply Last reply Reply Quote 0
              • P
                projectSB @punit last edited by

                @Ashok Yes, I checked out their documentation. But I am waiting for a formal release, with the classes from PyPi etc. The reason is that: yes, the fix may work temporarily, but if something breaks down during actual trade execution who will be liable?

                @admin V2 is still a Beta, when will it go Live? I mean I would want to install the latest modules from PyPi etc. like we did for V1.
                Please provide an ETA, so that we plan accordingly.

                punit 1 Reply Last reply Reply Quote 0
                • punit
                  punit @techsharad last edited by

                  @techsharad Sorry I donot have expertise with Java.

                  1 Reply Last reply Reply Quote 0
                  • punit
                    punit @projectSB last edited by

                    @projectSB Neither no one is liable if V1 fails in between a trade right :).
                    Looks like there is no active support/budget for API from AB and I have seen for public contribution for code changes. unfortunately it is what it is.

                    P 1 Reply Last reply Reply Quote 1
                    • P
                      projectSB @punit last edited by

                      @Ashok Yes, and I'm extremely disappointed with AB's apathy. Better get back to Zerodha APIs. At least there the @admin bothers to reply and works professionally and provides formal notifications before making abrupt changes!

                      S 1 Reply Last reply Reply Quote 0
                      • S
                        Shashi @projectSB last edited by

                        @projectSB where u able to connect to live stream? any help would be appreciated. Not able to get live feed for nifty and banknifty

                        1 Reply Last reply Reply Quote 0
                        • N
                          nbmaiti @punit last edited by

                          @Ashok
                          old websocket 1 streaming stopped and not working?

                          punit 1 Reply Last reply Reply Quote 0
                          • punit
                            punit @nbmaiti last edited by

                            @nbmaiti Yes correct. Only V2 works.

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