I need to square-off Nifty Option positions using API.
As of now, I place a sell order for Nifty options to square off, but this requires about 10x margin.
Example:
Step 1: Order API: BUY Order 1 lot of CE NIFTY-08AUG23-2500 @Market
Step 2: Order API: SL Order 1 lot of CE NIFTY-08AUG23-2500 @{some-stop-loss-price}
Step 3: Order API: SELL Order 1 lot of CE NIFTY-08AUG23-2500 @Target-Price
My step3 typically fails due to lack of margin
So, Is there a way to do ‘square-off’ instead of selling options using API?
@Amit_Kumar_Sharma Acknowledged. We are working on a similar approach to enable exiting all positions or specific order numbers through a single API. I will provide more details as soon as possible.
Hi @Pradeep_Jaiswar
Circling back on this one. Requesting you to please get this taken up on priority, as I am sure I am not the only one impacted. There must be many more API users, who are facing this challenge.
The absence of a options square off API is stopping me dead in the tracks from automating my intraday NIFTY CE & PE trades. I can not place SELL orders for CE and PE bought during day trade. If at least a GTT API can be provided for placing static target and SL, it will meet the requirements.
Example:
I buy NIFTY 25000 CE 12-SEP-2024, 1075 qty @ 94.4. Margin required = INR 1.01 lakh
Target price = 100 (6%)
Target price met
To SELL NIFTY 25000 CE 12-SEP-2024, 1075 qty @ 100, I will need a margin of about INR 28 lakhs!!!
Which means to make 6% on 1 lakh, I need to keep 28 lakhs in my wallet
Such margin requirement are not there when squaring off in UI using square off button or GTT orders.
PFA attached screenshots of margin requirements from Upstox margin calculator for your reference.
My question is : To square off my bought PUT or CALL positions, if I place a sell order (same instrument and same quantity), will it need the additional selling margins? Honestly, if I am holding Calls worth 6 lakhs, I do not want to end up in a soup when I try to square-it off by placing SELL order (due to huge margin requirements).
I continuously monitor for target and SL price in my code and want to place SELL Market orders the moment either Target or SL price is met.