Navigation

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

    Ad0rable

    @Ad0rable

    0
    Reputation
    2
    Posts
    1
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Ad0rable Follow

    Best posts made by Ad0rable

    This user hasn't posted anything yet.

    Latest posts made by Ad0rable

    • Error info: [Errno 8] nodename nor servname provided, or not known

      The thing is that, when I going to authenticate using the API, the error shows is this:

      Error info: [Errno 8] nodename nor servname provided, or not known
      [Errno 8] nodename nor servname provided, or not known
      Error info: SmartWebSocket.__on_close() takes 2 positional arguments but 4 were given
      SmartWebSocket.__on_close() takes 2 positional arguments but 4 were given
      

      While the two files which manage the auth and stream of data from the web socket are as follows:

      auth.py

      from SmartApi import SmartConnect
      import config
      
      def authenticate():
          obj = SmartConnect(api_key=config.API_KEY)
          data = obj.generateSession(config.CLIENT_ID, config.PASSWORD, config.TOTP)
      
          refreshToken = data['data']['refreshToken']
      
          feedToken = obj.getfeedToken()
          return obj, refreshToken, feedToken
      

      data_stream.py

      import json
      from SmartApi import SmartWebSocket
      import config
      import auth
      
      def stream(feedToken, clientCode):
          ss = SmartWebSocket(feedToken, clientCode)
          def on_message(ws, message):
              print("Ticks: {}".format(message))
          def on_open(ws):
              print("on open")
              ss.subscribe("mw", config.TOKEN)
          def on_error(ws, error):
              print(error)
          def on_close(ws, close_status_code, close_msg):
              print("### Connection closed ###")
              print(f"Status code: {close_status_code}, Message: {close_msg}")
      
          ss._on_open = on_open
          ss._on_message = on_message
          ss._on_error = on_error
          ss._on_close = on_close
          ss.connect()
      obj, refreshToken, feedToken = auth.authenticate()
      stream(feedToken, config.CLIENT_ID)
      

      It would be great if the issue of mine is resolved at the earliest. Thanks...

      posted in Python SDK
      A
      Ad0rable
    • RE: _WS.RunScript(sagr.feedToken, Client_code, script, TASK);

      mw: This stands for market watch, where you can monitor multiple stocks at once, receiving real-time quotes for your selected stocks.

      sfi: This refer to scrip feed information, which typically provides detailed stock-specific information such as the latest price, volume, and other metrics for individual instruments.

      dp: This stand for depth, which refers to market depth data showing the order book’s bid and ask levels, giving you insight into the buy and sell quantities at various price points for a stock.

      posted in C#/.Net SDK
      A
      Ad0rable