Navigation

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

    Order placement failed: string indices must be integers, not 'str'

    Python SDK
    0
    1
    6
    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
      rohya.tayade last edited by

      try:
      orderparams = {
      "variety":"NORMAL",
      "tradingsymbol":"SBIN-EQ",
      "symboltoken":"3045",
      "transactiontype":"BUY",
      "exchange":"NSE",
      "ordertype":"MARKET",
      "producttype":"INTRADAY",
      "duration":"DAY",
      "price":"194.50",
      "squareoff":"0",
      "stoploss":"0",
      "quantity":"1"
      }

          orderId=smartApi.placeOrder(orderparams)
          print("The order id is: {}".format(orderId))
      except Exception as e:
          print("Order placement failed: {}".format(e))
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post