Help with trailing Sell order placement

mkrathi
Hello, I am trying to place a trialing SELL order after I buy as stoploss strategy. Problem is when my code tries to place order in below, it is getting executed immediately. For e.g LTP is 250. And below code I am calculating Trigger rate as 240 and price as you can see is 20p less that. Now expectation is only when LTP hits 240.20 the sell order should be triggered instead the moment this line gets executed, order is being placed as market price. What is causing the order to execute immediately instead of waiting for trigger point.

myOrder.Sell_OrderID = kite.place_order(
tradingsymbol=myPosition.TradingSymbol,
exchange=myPosition.Exchange,
transaction_type="SELL",
quantity=myPosition.Qty,
order_type="LIMIT",
product=myPosition.Product,
price=myOrder.TriggerRate-0.20,
variety=kite.VARIETY_REGULAR,
trigger_price=myOrder.TriggerRate,
tag = 'MiTR')
This discussion has been closed.