SLM Order Failing

mlearner

Hi,

I am trying to place a SLM Buy order like below -

sl_price = 12938
order_id = kite.place_order(variety=kite.VARIETY_REGULAR,
tradingsymbol=tradingsymbol,
exchange="NFO",
transaction_type=kite.TRANSACTION_TYPE_BUY,
quantity=75,
order_type=kite.ORDER_TYPE_SLM,
product=kite.PRODUCT_MIS,
price=sl_price)
Getting below exception:

order_id = kite.place_order(variety=kite.VARIETY_REGULAR,tradingsymbol=tradingsymbol,exchange="NFO",transaction_type=kite.TRANSACTION_TYPE_BUY,quantity=75,order_type=kite.ORDER_TYPE_SLM,product=kite.PRODUCT_MIS,price=sl_price)
File "/home/ubuntu/.local/lib/python3.8/site-packages/kiteconnect/connect.py", line 346, in place_order
return self._post("order.place", params)["order_id"]
File "/home/ubuntu/.local/lib/python3.8/site-packages/kiteconnect/connect.py", line 821, in _post
return self._request(route, "POST", params)
File "/home/ubuntu/.local/lib/python3.8/site-packages/kiteconnect/connect.py", line 886, in _request
raise exp(data["message"], code=r.status_code)
<b class="Bold">kiteconnect.exceptions.InputException: Trigger price for stoploss buy orders should be higher than the last traded price (<b class="Bold">12863</b>). Try limit order to buy at a lower price. </b>[Read more.](https://support.zerodha.com/category/trading-and-markets/margin-leverage-and-product-and-order-types/articles/what-are-stop-loss-orders-and-how-to-use-them)
My SLM buy price is already higher than LTP of the instrument.

Why am I getting this error?

When I try to place the order manually, it works fine.

Thanks.
This discussion has been closed.