I am using kite.margins to check the availability of the margin before placing the trade. I check the margin requirements at https://api.kite.trade/margins/futures. However, it seems that despite having sufficient margin in the account returned by kite.margins, RMS rejects the trades. This could be due to the lag in kite.margins. I have also observed the lag of 3-5 mins in margin updation on kite dashboard. I am talking about the margin balance left after a trade execution(and not overnight settlement of delay of t+1, t+2).
Is this expected? Any updates on kite.margins api to be released?
is storing margin values at session start at 8:5am enough ? will margin values changes drastically with price change ? assume order requirement at day start is 30k , and I have 35k in account , will the margin requirement change more than 35k for the same symbol due to price change ? do i have to make call and check for margin requirement before placing an order to avoid insufficient funds error?
will the margin requirement change more than 35k for the same symbol due to price change ? do i have to make call and check for margin requirement before placing an order to avoid insufficient funds error?
Yes, we will recommend you make a fresh request for margin fetch before placing an order to avoid margin requirement error. As the margin requirement calculation not only depends on the LTP movement but also on other factors like existing positions and open orders. And this calculation is a bit difficult to be done at your end.
However, my issue is with the updation of the available balance after the order is executed. Say I have 1 lac INR at any point of time in trading account and margin required for an order is 75K. After that order is successfully executed, kite.margins(segment="equity")['available']['live_balance'] should return 25K. That is not updated immediately. So if I check the available amount before placing the next order using kite.margins, it would still be 1 lac and if my second order's margin requirement >25K, it would be rejected.
This has been happening consistently for couple of months. Is kite.margins(segment="equity")['available']['live_balance'] right way to check the available balance?
Not the margins requirement API.
However, my issue is with the updation of the available balance after the order is executed. Say I have 1 lac INR at any point of time in trading account and margin required for an order is 75K. After that order is successfully executed, kite.margins(segment="equity")['available']['live_balance'] should return 25K. That is not updated immediately. So if I check the available amount before placing the next order using kite.margins, it would still be 1 lac and if my second order's margin requirement >25K, it would be rejected.
This has been happening consistently for couple of months. Is kite.margins(segment="equity")['available']['live_balance'] right way to check the available balance?
You can check out this thread to know more about the funds. You seem to be looking at a wrong param.