margin fluctuations how to handle it

itsram90
Hi ,

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

?

thanks
Ram
Tagged:
  • ashishjindal89
    also, api margin data is not matching with that of margin google sheet for cover orders.

    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.
  • rakeshr
    rakeshr edited July 2020
    @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.
  • ashishjindal89
    @rakeshr is there something similar for java?
  • ashishjindal89
    also, can you tell us which source has true value? margin-api or google sheet?
  • ashishjindal89
    life would be much easier if you can just return correct values in the margin api itself.
  • ashishjindal89
    @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.
  • itsram90
    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.

    thanks
    ram
  • rakeshr
    @ashishjindal89 @itsram90
    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.
  • sujith
    @ashishjindal89 @itsram90
    You can refer to this thread for margin calculation API.
Sign In or Register to comment.