Navigation

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

    NIFTY and BANKNIFTY

    General Discussion
    2
    10
    107
    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.
    • R
      ravindra.e last edited by ravindra.e

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

      A 1 Reply Last reply Reply Quote 0
      • A
        admin @ravindra.e last edited by

        Hi @ravindra-e there is no such time line you can execute you orders in market hours.

        R 1 Reply Last reply Reply Quote 0
        • R
          ravindra.e @admin last edited by

          @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

          A 1 Reply Last reply Reply Quote 0
          • A
            admin @ravindra.e last edited by

            HI @ravindra-e please refer below mention link
            https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json

            R 1 Reply Last reply Reply Quote 0
            • R
              ravindra.e @admin last edited by

              @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'

              R 1 Reply Last reply Reply Quote 0
              • R
                ravindra.e @ravindra.e last edited by

                @ravindra-e Any update on this?

                A 1 Reply Last reply Reply Quote 0
                • A
                  admin @ravindra.e last edited by admin

                  Hi @ravindra-e If you want to execute orders in options pass exchange as NFO.

                  R 1 Reply Last reply Reply Quote 0
                  • R
                    ravindra.e @admin last edited by

                    @admin Why don't you update your documentation?

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      admin @ravindra.e last edited by

                      Dear @ravindra-e we really value your suggestion we will consider it for sure but we have already mentioned in the documentation.

                      R 1 Reply Last reply Reply Quote 0
                      • R
                        ravindra.e @admin last edited by

                        @admin Thank you. I will refer the documentation.

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