Square off half the position got a error Margin shortfall

Hi,

Context:
Bought 2 lots of BANKIFTYMAY23FUT at price 43197.55 after the order is complete, I placed Stoploss and target for 2 lots at 43175.35 and 43305.00rs respectively.

Now at half way to my target, I tried to exit 1 of the lot by placing market order in the opposite side and got an error “RED:Margin Shortfall:INR ******* Available:INR ****** For C XN***** [FYERS_RISK_CUG” and the stoploss and target orders are still active with a lot size of 2.

How do I overcome this margin shortfall error. Should i modify the stoploss and target first and then the position or is any other way?

Thanks

Hi @VWpI1FLz1l,

In this situation, you need to cancel any pending stop-loss or target orders before closing the position.

Ok will try it

Thanks