Navigation

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

    Posts made by HP

    • How to generate PIN

      How to generate PIN?

      posted in General Discussion
      H
      HP
    • Close websocket

      simple code:
      ss.ws.close()

      posted in Python SDK
      H
      HP
    • RE: takes 3 positional arguments but 4 were given

      @piidus https://smartapi.angelbroking.com/topic/2441/forget-login-issue

      posted in Python SDK
      H
      HP
    • Forget login issue

      from smartapi.smartWebSocketV2 import SmartWebSocketV2
      from smartapi import SmartConnect
      import pyotp

      def angelbrok_login():
      try:
      global feed_token, client_code, angel, password, totp

      	angel = SmartConnect(api_key="")
      	client_code = " "
      	password = " "
      	qrOtp = " "
      	totp = pyotp.TOTP(qrOtp)
      	totp = totp.now()
      
      	data = angel.generateSession(client_code,password,totp)
      	refreshToken = data['data']['refreshToken']
      	feed_token = angel.getfeedToken()
      	print("Login successful")
      except Exception as e:
      	print("Error in login", e)
      

      Note: once you login successfully, do not try to generate again,
      who will resolve my "In on pong function==> b'\x00'" issue ?

      posted in Python SDK
      H
      HP
    • No file name "smartWebSocketV2"

      file is missing from folder "SmartApi"

      posted in General Discussion
      H
      HP
    • what if I do not have android or IOS Phone?

      what if I do not have android or IOS Phone? ask to SEBI

      posted in General Discussion
      H
      HP
    • RE: What is the Symbol for L&T Ltd

      @praveen3405 it is LT

      posted in General Discussion
      H
      HP
    • How to edit " redirected to the URL" specified under MyApps

      How to edit?

      posted in General Discussion
      H
      HP
    • RE: WebSocketV2 not working to get Live Feed

      @J88913 said in WebSocketV2 not working to get Live Feed:

      from SmartApi.smartWebSocketV2 import SmartWebSocketV2
      AUTH_TOKEN = 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJ1c2VybmFtZSI6Iko4ODkxMyIsInJvbGVzIjowLCJ1c2VydHlwZSI6IlVTRVIiLCJpYXQiOjE2NjAxMDc2MDIsImV4cCI6MTc0NjUwNzYwMn0.GxHWWlTKnC-pGIyrz_PLBpwz4Dw2qYdQTTqum5KUKgSsaHFsts1gP1kzgkJELfTAbFmnlyA1dQtgruNP_5vWBQ'
      API_KEY = 'IpUZc95q'
      CLIENT_CODE = 'J77913'
      FEED_TOKEN = '0935239566'
      correlation_id = "erroroutp1"
      action = 1
      mode = 3
      token_list = [{"exchangeType": 1, "tokens": ["11536"]}]
      sws = SmartWebSocketV2(AUTH_TOKEN, API_KEY, CLIENT_CODE, FEED_TOKEN)
      def on_data(wsapp, message):
      print("Ticks: {}".format(message))
      def on_open(wsapp):
      print("on open")
      sws.subscribe(correlation_id, mode, token_list)
      def on_error(wsapp, error):
      print(error)
      def on_close(wsapp):
      print("Close")

      Assign the callbacks.

      sws.on_open = on_open
      sws.on_data = on_data
      sws.on_error = on_error
      sws.on_close = on_close

      sws.connect()

      I am using the above code but do not get any live feed. Only received following output
      on open
      In on pong function==> b'\x00'
      In on pong function==> b'\x00'
      In on pong function==> b'\x00'

      posted in Python SDK
      H
      HP
    • RE: API is down please fix it

      @admin ss = SmartWebSocket(FEED_TOKEN, CLIENT_CODE)
      TypeError: init() should return None, not 'str'

      posted in Python SDK
      H
      HP
    • websocket ohlc data

      Needs OHLC data to crate markteye, OPEN=LOW, OPEN=HIGH

      posted in Python SDK
      H
      HP
    • RE: SEBI's proposed algo trading guidelines for retail investors

      Like all securities, mutual funds are subject to market, or systematic, risk. This is because there is no way to predict what will happen in the future or whether a given asset will increase or decrease in value. Because the market cannot be accurately predicted or completely controlled, no investment is risk-free.

      so why need approval?
      simple arguement ask to SEBI

      posted in General Discussion
      H
      HP
    • [WinError 10054]

      [WinError 10054] An existing connection was forcibly closed by the remote host
      Error info: __on_close() takes 2 positional arguments but 4 were given

      posted in Python SDK
      H
      HP
    • RE: fetch banknifty index data

      ohlc= get_ohlc(name="BANKNIFTY25NOV21FUT", exchange="NFO")

      posted in Python SDK
      H
      HP
    • RE: "Order placement failed: 'NoneType' object is not subscriptable"

      @prasan
      orderparams={"variety": 'NORMAL',
      "tradingsymbol": 'BANKNIFTY07OCT2136100CE',
      "symboltoken": '40671',
      "transactiontype": 'BUY',
      "exchange": 'NFO',
      "ordertype": 'MARKET',
      "producttype": 'INTRADAY',
      "duration": 'DAY',
      "price": 0.0,
      "squareoff": 0.0,
      "stoploss": 0.0,
      "triggerprice": 0.0,
      "trailingstoploss": 0.0,
      "quantity": 1
      }

      posted in Python SDK
      H
      HP
    • RE: "Order placement failed: 'NoneType' object is not subscriptable"

      @prasan said in "Order placement failed: 'NoneType' object is not subscriptable":

      "tradingsymbol": "CRUDEOIL21NOV630000PE",
      "symboltoken": "233501",
      "transactiontype": "BUY",
      *** "exchange": "NFO",**

      wrong exchange

      posted in Python SDK
      H
      HP