order rejection due to margin availability. I call margin API for margin requirements

This is regarding order rejection due to margin availability. I call margin API for margin requirements
Url: https://api.kite.trade/margins/basket?consider_positions=false , for 1 Lot ATM PE Sell, 1 Lot ATM CE Sell, its giving margin requirement under final attribute i.e. 160000 ,
"final": {
"type": "",
"tradingsymbol": "",
"exchange": "",
"span": 140050.5,
"exposure": 37173.325,
"option_premium": -17123.75,
"additional": 0,
"bo": 0,
"cash": 0,
"var": 0,
"pnl": {
"realised": 0,
"unrealised": 0
"total": 160100.075

When i fire order its executing only one leg and failing on second, looks like earlier zerodha used to consider margin benefit after execution of one leg, but now zerodha wants full PE+CE margin combined , 2,97,000 even after one leg is executed.

This is giving me a lot of problems, this was working fine earlier, it has changed from 1st Sept.

I know margin is increased but margin benefit should still be there. Kindly revert at the earliest.
  • themohammedfaisal
    @puneeshtaneja88, there have been no changes in the margin benefit being passed on. The margin benefit kicks in when the first position is created. It could be that your second order reached the exchange before the completion of the first order and got rejected, can you try adding a 1-2 second lag to your orders to ensure that the first position is created and the margin benefit kicks in?
  • gaurmmec
    gaurmmec edited September 7
    @themohammedfaisal With due respect, this is not the case, In my case, after I have taken positions lets suppose, 3 lots of PE Banknifty Sell and 3 lots of CE banknifty Sell. Now after some time If i am trying to sell 1 CE its asking for margin greater than 2 lakh, which should not be the case as Delivery margin requirement is 1.5 lakh for 1 CE sell. Kindly try to replicate in your system. We were not facing this issue earlier with same codebase. Issue coming when we already have existing positions in the system not with fresh positions and I am not executing orders instantly so latency is not a issue here.
Sign In or Register to comment.