Incorrect rejection reason of SL orders placed through kiteconnect api

ShrinivasIyer
Hi team,


Please see the attached screenshots. My program is trying to place SL orders. Few orders placed successfully today but few got rejected with error message - "Insufficient funds. Required margin is 52178.87 but available margin is 50599.80. Check the orderbook for open orders."

Required margin is showing incorrect for these rejected orders. Please look into it. Thanks so much.
  • Sravanthi_bh
    It looks like there are open orders in the orderbook during that time and the required margin exceeds the available funds by 1579.07. You may refer to the relevant support article here.
  • ShrinivasIyer
    Please see the qty and the price of these orders. Multiply them.
    The margin required is wrong!
    For COCHINSHIP its 14*1884 = ~ 26,400 but the screenshot you can see its over ~50,000 in all the screenshots, which is wrong!
    This I have calculated without 5x leverage consideration. If I consider 5x leverage the margin required will be around 5000 INR for all the orders in the screenshot, but the error message says ~50,000
    I had enough margin i my funds that time.
  • Sravanthi_bh
    You may create a ticket here for more clarification on the same.
  • Sravanthi_bh
    Please note that margin calculations collectively include all pending orders.

    For example, if you have ₹100 and a pending order using ₹50, and you try to place an additional order requiring ₹60, your total required margin becomes ₹110.

    Since your available margin is only ₹100, the system will reject the new order due to a shortfall. The error message will indicate that the required margin is ₹110, but you only have ₹100 available.
  • ShrinivasIyer
    "For example, if you have ₹100 and a pending order using ₹50, and you try to place an additional order requiring ₹60, your total required margin becomes ₹110."

    This calculation is fine, but message to the suer must be USER FIRENDLY. User should see only particular order's correct rejection message, which was not the case.
  • sujith
    Unfortunately that is not how RMS works. It is always calculated against the portfolio or account level.
    If you want to know the required margins for each order then you may use margin calculation API.
Sign In or Register to comment.