For certain options, there is a limit on max quantity that can be entered in a single order and for bigger amount, one should use iceberg orders. Is there any API to know what's the max quantity of any instrument before placing order so that I can decide between placing regular order vs iceberg order (and also calculate number of legs and quantity for iceberg order)
Kite Connect doesn't have a separate API for freeze quantity. You need to place an order and in the 400 error response you will see the freeze quantity number.
We will try to improve this experience in the future. For now, this is the only way to check the freeze quantity number.
Got it, thanks. Also, if I place an iceberg order with a single leg, will it work like a normal order only? In my code, can I place all orders as variety = kite.VARIETY_ICEBERG and iceberg_legs can be 1 or more than 1 depending on the quantity I want to place?
Alternatively, if I place an order with variety = kite.VARIETY_REGULAR but also pass iceberg_legs and iceberg_quantity in params, would these values get ignored as its a regular order and not iceberg?
You need to specify the correct order variety. Minimum legs for an iceberg order is 2. You will get 400 (Input exception) error if you send iceberg order with iceberg_legs=1.
We will try to improve this experience in the future. For now, this is the only way to check the freeze quantity number.
In my code, can I place all orders as variety = kite.VARIETY_ICEBERG and iceberg_legs can be 1 or more than 1 depending on the quantity I want to place?
iceberg_legs=1
.A regular order will not consider iceberg params.
kite.place_order(
variety = variety,
exchange = exchange,
tradingsymbol = tradingsymbol,
transaction_type = buysell,
quantity = qty,
price = price,
product = product,
order_type = order_type,
validity = kite.VALIDITY_DAY,
tag = strategy_name,
iceberg_quantity = iceberg_quantity,
iceberg_legs = iceberg_legs,
But I am getting the following error:
couldn't execute: KiteConnect.place_order() got an unexpected keyword argument 'iceberg_quantity'