getMarginCalculation() giving wrong result for Cover Order

sudipto
Hi,
I am using the getMarginCalculation() as shown in the snippet below. This is taken from your own example. It is for calculating the margin required for Nifty Futures.
For "regular" variety, the result is given as 52,052.77, which is correct.
However if the variety is changed to "co" to find out the margin required for cover order, the result given by the APi is 9,03,345.00 which is obviously not correct. Could you please tell me what is going wrong?

MarginCalculationParams param = new MarginCalculationParams();
param.exchange = "NFE";
param.tradingSymbol = "NIFTY21FEBFUT";
param.orderType = "MARKET";
param.quantity = 75;
param.product = "MIS";
param.variety = "regular";
// param.variety = "co";
List params = new ArrayList<>();
params.add(param);
List data = kiteConnect.getMarginCalculation(params);
System.out.println(data.get(0).total);
  • rakeshr
    @sudipto
    You need to send trigger_price as extra param for SL, SL-M, CO orders. Check all param detail here.
  • sudipto
    Thanks, will try it out... but if trigger_price is required with CO Orders, then if it is missing then API should be giving error/exception response so that the programmer knows immediately that something is missing from the parameter. A helpful error message saying "trigger price is required" would enable the programmer to immediately rectify the mistake.
Sign In or Register to comment.