Hi, I am a trader who used to trade via BO with trigger and since that is closed i take entry using the stop loss order and once i take entry and try to exit the trade using the api its not letting me cancel the order because the trade status is complete not open or trigger pending whereas i can select all my open positions in the position tab and cancel all of them all together so how can i exit all my open positions irrespective of their order status i.e open or trigger pending or complete
If you have MIS open position then you can fetch positions, loop through that, and place a market order of the same quantity, product type, and opposite transaction type for each position in order to exit all positions.