Navigation

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

    wrong indentation error

    Python SDK
    3
    3
    15
    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.
    • L
      lavly last edited by

      orderparams = {
      "variety": "NORMAL",
      "tradingsymbol": "SBIN-EQ",
      "symboltoken": "3045",
      "transactiontype": "BUY",
      "exchange": "NSE",
      "ordertype": "LIMIT",
      "producttype": "INTRADAY",
      "duration": "DAY",
      "price": "390",
      "squareoff": "0",
      "stoploss": "0",
      "quantity": "10"
      }
      orderId=obj.place0rder(orderparams)
      print("The order id is: {}".format(orderId))
      except Exception as e:
      print("Order placement failed: {}".format(e.message))

      Iam using above code. It gives following errorr

      File "<ipython-input-44-d8c4717597ee>", line 15
      orderId=obj.place0rder(orderparams)
      ^
      IndentationError: unexpected indent

      Pl help

      James Bond 1 Reply Last reply Reply Quote 0
      • James Bond
        James Bond @lavly last edited by

        @lavly

        Properly formatting your code will solve the issue. This is very common issue of improperly formatted code.

        “Bond. James Bond.”

        S 1 Reply Last reply Reply Quote 0
        • S
          Surya 1 @James Bond last edited by

          @lavly

          Use pycharm, vscode or sublime text.. they will indent for you,..

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