Navigation

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

    Tick values are refreshing very slowly in websocket streaming.

    Python SDK
    7
    23
    168
    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
      princetech1 @admin last edited by

      @admin please provide me nifty Spot Live feed Python Code.

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

        HI @princetech1 you can get it though websocket or ltp API.

        W 1 Reply Last reply Reply Quote 0
        • W
          webseos @admin last edited by

          @admin What will be the code or JSON request format to get BankNifty Spot/ Nifty Spot/ Finnifty Spot

          A 2 Replies Last reply Reply Quote 0
          • A
            admin @webseos last edited by

            HI @webseos Please go through the instrument dump file.
            https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json

            W W 2 Replies Last reply Reply Quote 0
            • J
              J88913 @princetech1 last edited by

              @princetech1 for the live feed python code watch link text

              P P 3 Replies Last reply Reply Quote 0
              • A
                admin @webseos last edited by

                HI @webseos To Get live feed from websocket you need to pass task as "sfi" and pass nifty as token

                P W 3 Replies Last reply Reply Quote 0
                • P
                  princetech1 @admin last edited by

                  @admin token = 'nifty'
                  task='sfi'
                  WS = SmartWebSocket(feedToken, CLIENT_ID)

                  def on_tick(ws, tick):
                  print("Ticks: {}".format(tick))

                  def on_open(ws):
                  #print("on Open")
                  ws.subscribe(task,token)

                  def on_connect(ws, response):
                  ws.send_request(token)

                  def on_close(ws, code, reason):
                  ws.stop()

                  Assign the callbacks.

                  WS.on_ticks = on_tick
                  WS.on_connect = on_connect
                  WS.on_open = on_open
                  WS.on_close = on_close

                  WS.connect( )
                  print(WS)

                  please check and make the neccesary update in above Code=>

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

                    @admin I want to get spot Nifty and Not Futures.

                    P 1 Reply Last reply Reply Quote 1
                    • P
                      princetech1 @J88913 last edited by

                      @J88913 that link is not useful=> Nothing special to get Hinted.

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

                        @admin Exception while retriving IP Address,using local host IP address HTTPSConnectionPool(host='api.ipify.org', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000000003B68358>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed'))
                        __on_open################
                        {'task': 'cn', 'channel': 'NONLM', 'token': '090809502', 'user': 'SWWR1025', 'acctid': 'SWWR1025'}
                        2021-08-19 19:09:21.993348 : Start task in the background
                        {'task': 'hb', 'channel': '', 'token': '090809502', 'user': 'SWWR1025', 'acctid': 'SWWR1025'}

                        => above is the data generated after my previosly posted python code.

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

                          This post is deleted!
                          1 Reply Last reply Reply Quote 0
                          • A
                            admin @princetech1 last edited by

                            HI @princetech1 our team is working on websocket code we will update you once it is fixed.

                            1 Reply Last reply Reply Quote 0
                            • W
                              webseos @admin last edited by

                              @admin Can you show a sample code to get NIFTY/ BankNifty SPOT LTP Data. I think it always same, because NIFTY spot has no expiry

                              Query : Also can we get LTP of a premium related to a strike / expiry , e,g NIFTY 16000 CE 26 August 2021

                              Can we get LIVE premium ?

                              1 Reply Last reply Reply Quote 0
                              • W
                                webseos @admin last edited by

                                @admin What is SFI ? What is websocket's specialty over LTP or Historical API (Daily to 1 min)

                                Can we get many stock's data at once by multithreading?

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

                                  @admin I saw this , filtered out stock equity info of 1522 stocks symbol and token to a JSON file, but didnot parsed FNO data yet because of too much strike prices , expiry data,

                                  Saw different bank nifty , nifty strike, but could not find spot
                                  Can you tell the symbol to FIND exact JSON record for NIFTY Bank NIFTY Spot

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

                                    HI @webseos said in Tick values are refreshing very slowly in websocket streaming.:

                                    @admin What is SFI ? What is websocket's specialty over LTP or Historical API (Daily to 1 min)
                                    Can we get many stock's data at once by multithreading?

                                    1. You need to go through below documentation to understand all terms related to web socket.
                                      2)We only provide data for the symbol whose token are available in instrument dump file.
                                    1 Reply Last reply Reply Quote 0
                                    • P
                                      puna123 @J88913 last edited by

                                      @J88913 ,@admin
                                      i got the code from the link you have given but getting below error.
                                      would you be able to help?
                                      Error info: Handshake status 503 Service Unavailable
                                      Handshake status 503 Service Unavailable
                                      Error info: __on_close() takes 2 positional arguments but 4 were given
                                      __on_close() takes 2 positional arguments but 4 were given

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

                                        HI @puna123 said in Tick values are refreshing very slowly in websocket streaming.:

                                        @J88913 ,@admin
                                        i got the code from the link you have given but getting below error.
                                        would you be able to help?
                                        Error info: Handshake status 503 Service Unavailable
                                        Handshake status 503 Service Unavailable
                                        Error info: __on_close() takes 2 positional arguments but 4 were given
                                        __on_close() takes 2 positional arguments but 4 were given

                                        we will update you on this.

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

                                          @admin
                                          can you please update me on below error?

                                          1 Reply Last reply Reply Quote 0
                                          • P
                                            puna123 @J88913 last edited by

                                            @J88913 ,
                                            i am getting below error with this code. can you help.

                                            {'task': 'hb', 'channel': '', 'token': '093658357', 'user': '', 'acctid': ''}
                                            Error info: 'ltp'
                                            'ltp'

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