Comment on SPAN Calculator
Saitsh,
You asked if there is a way that it is executed only if both conditions are met. So either you can use day and keep as market orders for both the legs or else use IOC and keep limit order. If you are particular about the price, you will have to use IOC and limit order option.
About lack of margin, we usually wait until 10 to 15% drop in the exchange required margins and at that point we autosquare off, we don’t intimate before squaring off.
This link to monitor your positions: http://www.zerodha.com/z-connect/blog/view/zt-view-positions-using-admin-positions
This link to monitor your cash and margin utilization. If it is exceeding 100% then it means you are extending: http://www.zerodha.com/z-connect/blog/view/zt-view-cash-limit