Upcoming change in Margin requirements from 1st December 2020

sudipto
Hi,
We have been intimated that the margin requirements are going to change from 1st December 2020. The following is the formula you had provided for calculation of margin for Cover order and bracket order given below. It calculates the margin based on CO_upper and CO_lower as provided in the instrument API.
My question is whether this below formula still remains valid? Would all necessary changes be done at your end by updating the CO_upper and CO-lower?


// # Bracket and cover order Margins calculation:-
public static final double equity(double price, double stoploss, ZInstrument instrument, boolean isBuy) {
double margin;
double co_lower = instrument.getCo_lower()/100.0;
double co_upper = instrument.getCo_upper()/100.0;
int quantity = instrument.lot_size;

double trigger = price - (co_upper * price);

if (stoploss < trigger)
stoploss = trigger;
else
trigger = stoploss;

double x;

if (isBuy)
x = (price - trigger) * quantity;
else
x = (trigger - price) * quantity;

double y = co_lower * price * quantity;

margin = x > y ? x : y;
margin = margin + (margin * 0.2);
return margin;
}
  • sujith
    You don't need to do this anymore. You can use this API.
  • sudipto
    Hi Sujith,
    Thanks for pointing to this API. It was sorely needed, however I have two queries:
    1. I am interested in calculating the margin required for Cover Order. In the JSON Api link that you sent, it is not clear which field I should be reading for the same. Is it the BO field?
    2. I am using your java client library to access the API. Since I haven't found any Javadocs for the same, I am not sure if the same can be called through the java client library. If so, what is the name of the method?
  • sujith
    @sudipto,
    You can take a look at the API documentation once and go through the example here.
  • sujith
    You may have to update to the latest javakiteconnect.
  • RED
    @sujith
    Can't find the same(getMarginCalculation() method) in python. Is it to be updated?
  • rakeshr
    @RED
    It's released. You can update to the latest version using pip install --upgrade kiteconnect.
Sign In or Register to comment.