iceberg api confusion

jits_1998
hi,

please help me confirm the following parameters will work for both nifty (50) and bank nifty (15).

leg_count = orderInputParams.qty//750+1
...
to api:
iceberg_legs = leg_count,
iceberg_quantity = 750,
quantity=orderInputParams.qty,

I keep getting all kinds of errors when i try to have different config for iceberg orders. I know for Nifty it will place extra orders, i am good with it for now.

Thanks.
  • jits_1998
    i am getting invalid iceberg quantity for nifty. total quantity is 1050
  • jits_1998
    someone please help with formulas

    i am sending order for 1050 quantity nifty, iceberg_legs = 2, iceberg_quantity = 450

    tried with iceberg_quantity = 600

    either it says quantity is invalid or iceberg_quantity is invalid.
  • jits_1998
    @sujith can you please help
  • jits_1998
    looks like the validation on iceberg_quantity is that it should be nearest multiple of lot size for total quantity / leg count
  • sujith
    You may try this formula
    s = quantity / Max(legCount, 2)
    iceberg_qty = (s/lotSize).ceil() * lotSize
  • sutolani@gmail.com
    What further checks are needed...For eg, hypothetically, if I want to Sell 1500 Contracts of MIDCAPNIFTY in 3 legs, with above formula, Iceberg Quantitiy comes as 500....but 500 is NOT a mutilple of 75 which is the midcapnifty Lot Size....
  • sujith
    The first check should be to check if the quantity being sent should be a multiple of lot size.
  • akhilesh_singla
    @sujith Does that mean in below order I should change quantity to 2400?
    {
    exchange: 'NFO',
    variety: 'iceberg',
    iceberg_legs: 2,
    iceberg_quantity: 1200,
    tradingsymbol: 'NIFTY25APR23800PE',
    transaction_type: 'SELL',
    order_type: 'MARKET',
    quantity: 2475,
    product: 'MIS'
    }
  • sujith
    The first order will go through with the quantity specified that is 1200 and then the second order will be placed with the quantity of 2475-1200 (1275)
  • akhilesh_singla
    @sujith I tried executing:
    {
    exchange: 'NFO',
    tradingsymbol: 'NIFTY25APR22700PE',
    transaction_type: 'BUY',
    order_type: 'MARKET',
    quantity: 3375,
    product: 'MIS',
    variety: 'iceberg',
    iceberg_legs: 2,
    iceberg_quantity: 1725
    }


    Got error:
    "Missing or empty field `exchange`","data":null,"error_type":"InputException"

    Above order worked in finding margin but not working when placing the order! I have read all iceberg posts and documentation. Every combination throws a new error!
  • akhilesh_singla
    Update: I was able to resolve aforementioned error as the issue was a bug in my code. Although need to retest during market hours.
Sign In or Register to comment.