Navigation

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

    trailing stoploss not working using api

    Python SDK
    0
    5
    39
    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.
    • V
      vksaini last edited by

      def place_order(symbol, token, limit_price, trigger_price, quantity, stoploss, target, trailing):
      try:
      orderparams = {
      "variety": "ROBO",
      "tradingsymbol": symbol,
      "symboltoken": token,
      "price": limit_price,
      "triggerprice": trigger_price,
      "quantity": quantity,
      "transactiontype": "BUY",
      "exchange": "NFO",
      "ordertype": "STOPLOSS_LIMIT",
      "producttype": "INTRADAY",
      "duration": "DAY",
      "squareoff": target,
      "stoploss": stoploss,
      "trailingStopLoss": trailing
      }
      p = smartApi.placeOrderFullResponse(orderparams)
      print("order placed from place_order function..")
      return p
      except:
      print("order placement failed from place_order function..")
      return None
      Trailing stoploss is not working. could you please look into it .

      M 1 Reply Last reply Reply Quote 0
      • M
        Moderator_3 @vksaini last edited by Moderator_3

        Hello @vksaini

        You don't want to pass the triggerprice key in the request So kindly remove the same from your request the check
        As of now the trading stop loss doesn't work we will let you know once it's started the working

        Regards,
        SmartAPI Team

        V 1 Reply Last reply Reply Quote -1
        • V
          vksaini @Moderator_3 last edited by

          @Moderator_3 I want to place stoploss limit order. So that I buy security at desired price. What is the way to place robo order for stoploss limit order with trailing stoploss

          M 1 Reply Last reply Reply Quote 0
          • M
            Moderator_3 @vksaini last edited by

            Hello @vksaini
            To place ROBO order you don't want to pass the triggerprice in request body.The triggerprice is only need for GTT.

            Regards,
            SmartAPI Team

            1 Reply Last reply Reply Quote 0
            • D
              dhaval0208 last edited by

              I think you should try this :
              orderparams = {
              "variety": "ROBO",
              "tradingsymbol": symbol,
              "symboltoken":token,
              "transactiontype":buy_sell,
              "exchange":exch_seg,
              "ordertype":ordertype,
              "producttype":"BO",
              "duration":"DAY",
              "price":str(price),
              "squareoff":str(target),
              "stoploss":str(stoploss),
              "quantity":qty
              }
              It's working for me, I'm sure it will work.

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