most of my setups and systems are doing intraday option trading. all trades are hedged, means there would be some option buy as well as sell.
recently i am observing , cost/margin of trade has become impossible to define , is there a way where i can calculate using API margin needed for this trade for intraday using MIS limit orders :
SELL NIFTY JUL 10700 CE NFO MIS QTY 1050 BUY NIFTY 9th w JUL 10400 CE NFO MIS qty 2100
check for L&TFH. google sheet says a leverage of 24x whereas api says 8.33. Which source should be considered true? @rakeshr@sujith
one more thing, as per this thread if I calculate CO margin for L&TFH as per google sheet data ( BO/CO Margin 4.10% ), leverage multiplier should be 100/(1.2 * 4.1) i.e 20.32 but google sheet says 24.39 which just 100/4.1 . CO/BO margin calculation is so confusing and all over the place. Can someone please help out here.
@ashishjindal89 You can use this package as per your requirement. Returns dict with all the values, you need. Currently, it has mis_status details(along with margin multiplier). By EOD will add for BO/CO multiplier as well.
@itsram90 sorry i hijacked your thread. @rakeshr as I understand what @itsram90 is saying is that if we have a combo of hedged trades, margin required will be different than the sum of individual trade. It would be great if you can expose an API where we can post our combo/hedged trade data and it can return the margin required for it. This API will be super useful for CO/BO orders as well. Going forward you can add this logic as offline function in your clients ( python/java etc) but for now API will work as well. Right now only way is to either refer the docs or place the actual order & check the margin utilization. You need to understand that knowledge of margin required is extremely important before placing a trade especailly for an automated small account setup.
thank you, @rakeshr i have live algo and im hitting this issue every now and then. this is something very important and critical to me.
pl suggest some why where i can get right numbers. happy with 5% here and there but when margin needed becomes double, my second leg gets rejected and this has caused some very hurtful trades.
check for L&TFH. google sheet says a leverage of 24x whereas api says 8.33. Which source should be considered true? @rakeshr @sujith
one more thing, as per this thread if I calculate CO margin for L&TFH as per google sheet data ( BO/CO Margin 4.10% ), leverage multiplier should be 100/(1.2 * 4.1) i.e 20.32 but google sheet says 24.39 which just 100/4.1 .
CO/BO margin calculation is so confusing and all over the place. Can someone please help out here.
You can use this package as per your requirement. Returns dict with all the values, you need. Currently, it has mis_status details(along with margin multiplier). By EOD will add for BO/CO multiplier as well.
@rakeshr as I understand what @itsram90 is saying is that if we have a combo of hedged trades, margin required will be different than the sum of individual trade. It would be great if you can expose an API where we can post our combo/hedged trade data and it can return the margin required for it.
This API will be super useful for CO/BO orders as well. Going forward you can add this logic as offline function in your clients ( python/java etc) but for now API will work as well.
Right now only way is to either refer the docs or place the actual order & check the margin utilization.
You need to understand that knowledge of margin required is extremely important before placing a trade especailly for an automated small account setup.
pl suggest some why where i can get right numbers. happy with 5% here and there but when margin needed becomes double, my second leg gets rejected and this has caused some very hurtful trades.
thanks
ram
We are working on this. Most of the above-stated queries will be taken care of. It will be live soon. We will update here.
You can refer to this thread for margin calculation API.