Hi, I am using the Java library to connect to Kite. Here is the JSON dump of the OrderParams that I am sending to execute an iceberg order. I am getting an error message with Code 400 and "Invalid `iceberg_quantity`" error. What am I doing wrong here? This same api used to work when the lot size was 75 and 1800 was max size per order. { "exchange": "NFO", "tradingsymbol": "NIFTY2611326200CE", "transactionType": "BUY", "quantity": 1820, "price": 93.6, "product": "NRML", "orderType": "LIMIT", "tag": "SG01002026-01-13", "validityTTL": 0, "icebergQuantity": 1690, "icebergLegs": 2, "marketProtection": 0 }
Thanks Nagavenji, I went through the doc and will modify the same, but it doesn't mention what should be the iceberg quantity when the total is an odd number of lots ... i.e. the division would lead to a quantity which is not a whole number of lots. What should be the number of iceberg quantity entered in such a case?
@nagavenij ... to clarify, if I have 31 lots to sell in 2 legs, then the number of lots in the iceberg quantity would be 31/2 = 15.5 -- In such a case what should be the iceberg quantity? Should it be 15x65 or 16x65?
For an odd lot of 31 lots, the first leg will be placed as 16 × 65, and the second leg as 15 × 65. The quantity is rounded up as per the formula below:
I went through the doc and will modify the same, but it doesn't mention what should be the iceberg quantity when the total is an odd number of lots ... i.e. the division would lead to a quantity which is not a whole number of lots. What should be the number of iceberg quantity entered in such a case?
s = quantity / max(legCount, 2)
iceberg_quantity = ceil(s / lotSize) × lotSize
You may refer to the link below for more details.