I have setup regular SL-M order, both buy and sell side, kind of range break out in any direction. let's say buy side is hit. SL-M order gets completed. Now there is a intraday position. but kite.orders() is not giving the orderid of this position.
Unfortunately, OMS doesn't have a mechanism to map a position to orders. It just shows your mark to market. For an SL-M order, once the trigger is hit, a market order is placed. Hence orderbook will show order type as MARKET for this entry. Maybe you can use the tag feature to tag your orders and cancel the opposite side orders from orderbook.
There will be one position entry for an instrument in the same product type on positions even though there are multiple orders executed on that instrument.
is there a way to cancel this position programatically? that is what i am looking for.
"Maybe you can use the tag feature to tag your orders and cancel the opposite side orders from orderbook." this statement i am not able to understand. the log, which i pasted has the output of kite.orders, it does not show any new entry, when i tried cancelling other three it worked. but position was still alive. i want a way to exit this position
In order to close a position, you need to place a market order with the same product type (MIS/NRML) and the opposite transaction type. If it is bracket or cover order then you need to send an exit request as mentioned here.
What I meant was, if you are running multiple strategies on the same instrument then you can use the tag feature to keep track of quantities of different strategies, which you already seem to be using. You have set the value as 'twhbc'
For an SL-M order, once the trigger is hit, a market order is placed. Hence orderbook will show order type as MARKET for this entry.
Maybe you can use the tag feature to tag your orders and cancel the opposite side orders from orderbook.
There will be one position entry for an instrument in the same product type on positions even though there are multiple orders executed on that instrument.
"Maybe you can use the tag feature to tag your orders and cancel the opposite side orders from orderbook." this statement i am not able to understand. the log, which i pasted has the output of kite.orders, it does not show any new entry, when i tried cancelling other three it worked. but position was still alive. i want a way to exit this position
What I meant was, if you are running multiple strategies on the same instrument then you can use the tag feature to keep track of quantities of different strategies, which you already seem to be using. You have set the value as 'twhbc'