Hi, I am trying to understand the margin requirement for placing a Nifty put spread using the Kite API. My goal is to utilise the maximum available margin in my account and place a put spread order for as many lots as possible, given my account balance.
My Approach: I want to place the following spread: * Sell: NIFTY2543024800PE * Buy: NIFTY2543022850PE Here’s what I did: 1. First, I checked the required margin for placing a sell order for one lot using kite.basket_order_margins. The margin required at this stage is approximately ₹2.63 lakh. 2. After placing the buy order for the lower strike, I see that the margin used drops to about ₹1.47 lakh.
3. However, the next day after both orders are placed, my account shows that the margin used has increased to around ₹1.83 lakh (with SPAN = ₹1.47 lakh + Exposure = ₹0.36 lakh). * Initial Required Margin: ₹2,63,918.48 * Final Margin After Both Legs: ₹1,46,963.48 * Margin Used Next Day: ₹1,83,000 (approx; SPAN + Exposure)
I am unable to derive a consistent logic to find the final margin required to maintain a put spread position once it is open, especially to calculate the maximum lots I can trade with my available funds. * How can I accurately determine the final margin required to maintain a put spread (after both legs are placed and positions are open)?
Note: I am aware of the requirement to maintain an extra 2% margin on expiry day and am already accounting for that in my code.
Would appreciate any guidance on this please. Thanks! Vijay
Margin Used Next Day: ₹1,83,000 (approx; SPAN + Exposure)
It's because of the change in required margin BOD(beginning of the next day margin file). This article explains in detail. I just checked for current required margins, and it's "total": 188533.8.
Hi @rakeshr, thanks for your response, that clarifies. Earlier I was not fetching it correctly. I hope this is the file (https://api.kite.trade/margins/basket) we need to refer and add final span and exposure to get the final margin required for a spread?
I've now checked for SELL:NIFTY2550824900PE and BUY:NIFTY2550822850PE, got the below total margin. Final SPAN Margin: ₹151246.5 Final Exposure Margin: ₹37388.700000000004 Final Combined Margin Required: ₹188635.2
"total": 188533.8
.I hope this is the file (https://api.kite.trade/margins/basket) we need to refer and add final span and exposure to get the final margin required for a spread?
I've now checked for SELL:NIFTY2550824900PE and BUY:NIFTY2550822850PE, got the below total margin.
Final SPAN Margin: ₹151246.5
Final Exposure Margin: ₹37388.700000000004
Final Combined Margin Required: ₹188635.2