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