Navigation

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

    Posts made by ravindra.e

    • Algo code not working from 10th Nov

      Hello @admin , i run the code from Oracle cloud form Linux instance. It stopped working Nov 10th. Is there anything changed? Code is working fine from my local now. But not cloud. Below is the error
      HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Max retries exceeded with url: /rest/auth/angelbroking/user/v1/loginByPassword (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fc916216860>, 'Connection to apiconnect.angelbroking.com timed out. (connect timeout=20)'))

      posted in Python SDK
      R
      ravindra.e
    • RE: Guide to secure your SmartAPI Account with two factor authentication

      @ganesh
      update using pip install smartapi-python --upgrade

      posted in General Discussion
      R
      ravindra.e
    • RE: Guide to secure your SmartAPI Account with two factor authentication

      @Sukhwant280 said in Guide to secure your SmartAPI Account with two factor authentication:

      smartApi.generateToken(refreshToken)

      Why would you need smartApi.generateToken(refreshToken)?

      posted in General Discussion
      R
      ravindra.e
    • RE: Guide to secure your SmartAPI Account with two factor authentication

      @smrtsaravanan Can you please paste your code here?

      posted in General Discussion
      R
      ravindra.e
    • RE: Not Able to Login even after TOTP updation in code.

      Please Upgrade smartapi-python to latest version.

      posted in Python SDK
      R
      ravindra.e
    • RE: Guide to secure your SmartAPI Account with two factor authentication

      For Python, below code works like charm.

      Screenshot 2022-10-02 at 3.05.46 PM.png

      posted in General Discussion
      R
      ravindra.e
    • RE: NIFTY and BANKNIFTY

      @admin Thank you. I will refer the documentation.

      posted in General Discussion
      R
      ravindra.e
    • RE: NIFTY and BANKNIFTY

      @admin Why don't you update your documentation?

      posted in General Discussion
      R
      ravindra.e
    • RE: NIFTY and BANKNIFTY

      @ravindra-e Any update on this?

      posted in General Discussion
      R
      ravindra.e
    • RE: NIFTY and BANKNIFTY

      @admin I saw this URL. When i tried below code, it failed.
      #fetch User Profile
      userProfile= obj.getProfile(refreshToken)

      print(userProfile)
      #place order
      try:
      orderparams = {
      "variety": "NORMAL",
      "tradingsymbol": "BANKNIFTY29APR2138000PE",
      "symboltoken": "43178",
      "transactiontype": "BUY",
      "exchange": "NSE",
      "ordertype": "MARKET",
      "producttype": "INTRADAY",
      "duration": "DAY",
      "price": "40",
      "squareoff": "0",
      "stoploss": "0",
      "quantity": "1"
      }
      orderId=obj.placeOrder(orderparams)
      print("The order id is: {}".format(orderId))
      except Exception as e:
      print("Order placement failed: {}".format(e.message))

      I could print user profile
      Please find error below.
      TypeError Traceback (most recent call last)
      <ipython-input-22-0393c4a0d383> in <module>
      20 }
      ---> 21 orderId=obj.placeOrder(orderparams)
      22 print("The order id is: {}".format(orderId))

      ~/opt/anaconda3/lib/python3.7/site-packages/smartapi/smartConnect.py in placeOrder(self, orderparams)
      289
      --> 290 orderResponse= self._postRequest("api.order.place", params)['data']['orderid']
      291

      TypeError: 'NoneType' object is not subscriptable

      During handling of the above exception, another exception occurred:

      AttributeError Traceback (most recent call last)
      <ipython-input-22-0393c4a0d383> in <module>
      22 print("The order id is: {}".format(orderId))
      23 except Exception as e:
      ---> 24 print("Order placement failed: {}".format(e.message))

      AttributeError: 'TypeError' object has no attribute 'message'

      posted in General Discussion
      R
      ravindra.e
    • RE: NIFTY and BANKNIFTY

      @admin What I meant is, can i place orders for NIFTY and BANKNIFTY options. If so what code should I use? I am using Python

      posted in General Discussion
      R
      ravindra.e
    • NIFTY and BANKNIFTY

      Hi, What are the timelines to enable orders against NIFTY and Banknity options?

      posted in General Discussion
      R
      ravindra.e
    • RE: getfeedToken

      @admin Thank you. This code is working.

      posted in Python SDK
      R
      ravindra.e
    • getfeedToken

      I am getting bellow error

      AttributeError: 'SmartConnect' object has no attribute 'getfeedToken'

      Code:

      package import statement

      from smartapi import SmartConnect #or from smartapi.smartConnect import SmartConnect
      #import smartapi.smartExceptions(for smartExceptions)

      #create object of call
      obj=SmartConnect(api_key="Z********")

      #login api call

      data = obj.generateSession("R18***","*******")
      refreshToken= data['data']['refreshToken']

      #fetch the feedtoken
      feedToken=obj.getfeedToken()

      posted in Python SDK
      R
      ravindra.e