Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. shenoytech
    3. Posts
    S
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by shenoytech

    • RE: Streaming only 5-7 scripts even when subscribed to nifty50 stocks why?

      @admin yes please close the thread

      posted in Python SDK
      S
      shenoytech
    • RE: No able to generate feed_token today:

      @admin yes there is no issue ,you can close the discussion

      posted in Python SDK
      S
      shenoytech
    • No able to generate feed_token today:

      Hi, @admin @bhaveshjain i'm not able to generate feed_token today, is there any issue from your side,also yesterday i did face some issue while streaming data, where the websocket streaming service was closed after 5-10 minutes,

      posted in Python SDK
      S
      shenoytech
    • RE: Streaming only 5-7 scripts even when subscribed to nifty50 stocks why?

      @admin i can confirm that from your side only 5-6 scripts are allowed to stream in a time ,please check from your side.

      posted in Python SDK
      S
      shenoytech
    • RE: Probable inconsistency in the streaming data

      @taleevaalam1 @bhaveshjain hi bhavesh this is the issue i was speaking to you during conversation held with you, day before yesterday.

      also @taleevaalam1 @rjbanna i need to ask you how many scripts data you can stream at a time cause i have subscribed for 50 scripts but i'm able to get data of only few scripts.

      posted in General Discussion
      S
      shenoytech
    • RE: Streaming only 5-7 scripts even when subscribed to nifty50 stocks why?

      @admin ok then why i'm getting data of only few scripts.

      posted in Python SDK
      S
      shenoytech
    • Streaming only 5-7 scripts even when subscribed to nifty50 stocks why?

      Hi @admin @bhaveshjain i have subscribed to 50 nifty stocks for streaming the data , but as i'm getting max streaming data of 5-7 scripts, is there any limit on numbers of scripts can be streamed in a time or is there any other issue, please do let me know.

      posted in Python SDK
      S
      shenoytech
    • RE: Python Streaming Tick Data Problem.

      @admin hi admin now it working fine.

      posted in Python SDK
      S
      shenoytech
    • RE: Python Streaming Tick Data Problem.

      @rjbanna said in Python Streaming Tick Data Problem.:

      data = bytes((zlib.decompress(data)).decode("utf-8"), 'utf-8')

      thankyou @rjbanna now it is working 🙂

      posted in Python SDK
      S
      shenoytech
    • RE: Python Streaming Tick Data Problem.

      @rjbanna ok..that i never thought silly of me thats why i was confused even when i was not using print function it was printing the streaming data. @admin and @bhaveshjain it is really bad that you advertising it as a free API but i think for full operation it will take some time, so at least give us time frame for full launch of the service.

      posted in Python SDK
      S
      shenoytech
    • RE: Python Streaming Tick Data Problem.

      @admin ok now i have got the streaming output as:

      [{"ak":"ok","task":"cn","msg":"connected"}]
      [{"ak":"ok","task":"mw","msg":"mw"}]
      [{"ak":"ok","task":"mw","msg":"mw"}]
      []
      
      [{"tvalue":"10\/12\/2020 10:35:00","name":"tm"{"to":"5592405812.40","lo":"2001.00","e":"nse_cm","sp":"2008.00","c":"2026.95","ltp":"2008.00","ltq":"27","tk":"2885","bs":"714","ltt":"10\/12\/2020 10:35:00","tsq":"781238","v":"2780424","bp":"2007.95","cng":"-18.95","bq":"39","ap":"2011.35","nc":"-00.93","name":"sf","tbq":"518673"},
      {"to":"2281841541.00","lo":"2785.05","e":"nse_cm","sp":"2792.35","c":"2810.80","ltp":"2792.35","ltq":"3","tk":"11536","bs":"9","ltt":"10\/12\/2020 10:35:00","tsq":"199536","v":"813926","bp":"2791.40","cng":"-18.45","bq":"15","ap":"2803.50","nc":"-00.66","name":"sf","tbq":"139632"}]
      
      

      but issue is i'm not able to parse this dictionary in a list using python , or say get a data from dictionary, can anyone help me out in this one, also there is some using with streaming service in python as the connection closes on its own after sometime.

      posted in Python SDK
      S
      shenoytech
    • RE: what am i doing wrong regarding feed token its not generating pardon my amateurness

      @RazorFangs

      following is the code for your help.

      # from smartapi.smartSocket import SmartSocket
      # from smartapi import SmartSocket
      from pprint import pprint
      from smartapi.smartConnect import SmartConnect
      from smartapi import SmartConnect
      from smartapi import WebSocket
      
      
      api_key = "your API key"
      client_code = "your Client code"
      password = "your password#"
      
      obj = SmartConnect(api_key=api_key)
      
      data = obj.generateSession(client_code, password)
      tokens = obj.generateToken(data["data"]["refreshToken"])
      feed_token = tokens["data"]["feedToken"]
      
      token = "nse_cm|2885"
      
      ss = WebSocket(feed_token, client_code)
      
      def on_tick(ws, tick):
          print("Ticks: {}".format(tick))
      
      def on_connect(ws, response):
          ws.send_request(token)
      
      
      def on_close(ws, code, reason):
          ws.stop()
      
      # Assign the callbacks.
      ss.on_ticks = on_tick
      ss.on_connect = on_connect
      ss.on_close = on_close
      
      ss.connect()
      
      posted in Python SDK
      S
      shenoytech
    • RE: Python Streaming Tick Data Problem.

      @admin yes thankyou now it is working

      posted in Python SDK
      S
      shenoytech
    • RE: Python Streaming Tick Data Problem.

      @mihirk yes but it was of no help

      posted in Python SDK
      S
      shenoytech
    • Python Streaming Tick Data Problem.

      Hi,

      following is the code i'm using to stream live stock data in python pycharm, anyone could please let me know weather the code is write or do i have to change something at below code.
      @bhaveshjain since you have told in one of the threadpost that python error is solved but i'm getting same output as shown below,

      
      from smartapi.smartSocket import SmartSocket
      from smartapi import SmartConnect
      
      
      api_key = "my API key"
      client_code = "my client code"
      password = "my password"
      
      obj = SmartConnect(api_key=api_key)
      
      data = obj.generateSession(client_code, password)
      tokens = obj.generateToken(data["data"]["refreshToken"])
      feed_token = tokens["data"]["feedToken"]
      
      token = "nse_cm|2885"
      
      ss = SmartSocket(feed_token, client_code)
      
      def on_tick(ws, tick):
          print("Ticks: {}".format(tick))
      
      def on_connect(ws, response):
          ws.send_request(token)
      
      # Assign the callbacks.
      ss.on_ticks = on_tick
      ss.on_connect = on_connect
      
      ss.connect()
      

      Following is the Output i'm receiving.

      PAYLOAD eJyLrlZKzFayUsrPVtJRKkksBrGT84Ds3OJ0EDM/Ly81uSQ1Rak2FgAaGQ1z
      DATA b'x\x9c\x8b\xaeVJ\xccV\xb2R\xca\xcfV\xd2Q*I,\x06\xb1\x93\xf3\x80\xec\xdc\xe2t\x103?//5\xb9$5E\xa96\x16\x00\x1a\x19\rs'
      PAYLOAD eJyLrlZKzFayUsrPVtJRKkksBrGT84Ds3OJ0EDM/Ly81uSQ1Rak2FgAaGQ1z
      DATA b'x\x9c\x8b\xaeVJ\xccV\xb2R\xca\xcfV\xd2Q*I,\x06\xb1\x93\xf3\x80\xec\xdc\xe2t\x103?//5\xb9$5E\xa96\x16\x00\x1a\x19\rs'
      

      So i request any fellow traders also @bhaveshjain if you can provide me a snippet of python code for streaming tick data.

      posted in Python SDK
      S
      shenoytech
    • RE: Immediate Action Needed

      @taleevaalam1 hi, can you please share a snipe of python code you are using for streaming the tick data , as i'm trying but i'm not able to get the above format data, whereas @bhaveshjain had messaged me in one of the post that there is some issue with python websocket streaming service, they are trying to fix that,

      posted in General Discussion
      S
      shenoytech
    • RE: Livefeed using sockets

      @bhaveshjain ok ..

      posted in Python SDK
      S
      shenoytech
    • RE: Livefeed using sockets

      It looks like issue is with the python, i think they have not started python websocket streaming service, there is no word from @bhaveshjain regarding this matter, and there is no proper documentation for python ,
      so I'm hoping @bhaveshjain could clarify this matter, and how long it will take when service will resume for python.

      posted in Python SDK
      S
      shenoytech
    • RE: Error while placing order

      @harish hi harish are you able to stream tick data , if yes could you please let us know how you did that.

      posted in Python SDK
      S
      shenoytech