trailing stoploss not working using api
-
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 . -
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. -
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 -
@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
-
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 workingRegards,
SmartAPI Team