Hi, We have a use case where we would like to place multiple orders using the java sdk in android. can you please guide how to do the same. We have found the sdk call for doing it just for one order at a time Regards
when i tried it with the mentioned example i am getting following error printed in webview: { "status": "error", "message": "Invalid orders payload.", "data": null, "error_type": "InputException" } the request i am sending is as followed: <!-- <form method= "post" id="basket-form" action="https://kite.trade/connect/basket"> --!> <!-- <input type="hidden" name="api_key" value=AppConstant.ZERODHA.API_KEY />--!> <!-- <input type="hidden" id="basket" name="data" value="" />--!> <!-- </form>--!> <!-- <script>--!> <!-- document.getElementById("basket").value = new Gson().toJson(paramList);--!> <!-- document.getElementById("basket-form").submit();--!> <!-- </script> --!>
You seem to be using an invalid tradingsymbol, the product type is missing, for F&O instruments the exchange value has to be NFO. You can refer to the documentation here.
@sujith was able to make it work issue was that i was sending quantity as string when it was expecting it as integer. Thanks for your help. There is one doubt that after placing the order successfully I am not getting the details in holdings neither in api nor on the console but orders listing does shows the stocks that I have purchased. Is holding section updated next day or something?
@njawahire You will be able to see these placed orders same day on Order book.And next day on holdings. You can get complete list of orders using retrive order's API, check the documentation here.
If a user has already logged in then you will be redirected directly to redirect URL upon opening the login URL. You just need to check the login to kite web option on the login page.
Dear Sujith sir, I am running a algo in python for options.which was running well.but as a I tried to scale up with 10/15 lots I started loosing on slippage.for which I used for loop to fire orders in lots with 10 sec sleep.but for each lot my orders are getting placed two times.can you please help.
If you just want to place multiple order at a time, you may try using publisher basket, check documentation here.
{
"status": "error",
"message": "Invalid orders payload.",
"data": null,
"error_type": "InputException"
}
the request i am sending is as followed:
<!-- <form method= "post" id="basket-form" action="https://kite.trade/connect/basket"> --!>
<!-- <input type="hidden" name="api_key" value=AppConstant.ZERODHA.API_KEY />--!>
<!-- <input type="hidden" id="basket" name="data" value="" />--!>
<!-- </form>--!>
<!-- <script>--!>
<!-- document.getElementById("basket").value = new Gson().toJson(paramList);--!>
<!-- document.getElementById("basket-form").submit();--!>
<!-- </script> --!>
<--! <input type="hidden" name="api_key" value="MY_API_KEY" /> !-->
<--! <input type="hidden" id="basket" name="data" value="" /> !-->
<--! </form> !-->
<--! <script> !-->
<--! document.getElementById("basket").value = [{ "variety": "regular", "tradingsymbol": "INFY", "exchange": <--! NSE", "transaction_type": "BUY", "order_type": "MARKET", "quantity": 10, "readonly": false }, { "variety": "regular", "tradingsymbol": "NIFTY15DECFUT", "exchange": "NFO", "transaction_type": "SELL", <--! "order_type": "LIMIT", "price": 7845, "quantity": 1, "readonly": false }, { "variety": "bo", "tradingsymbol": "RELIANCE", "exchange": "NSE", "transaction_type": "BUY", "order_type": "LIMIT", "product": "MIS", "price": 915.15, "quantity": 1, "stoploss": 5, "squareoff": 7, "trailing_stoploss": 1.5, "readonly": true }]; !-->
<--! document.getElementById("basket-form").submit();
<--! </script> !-->
You can refer to the documentation here.
Thanks for your help. There is one doubt that after placing the order successfully I am not getting the details in holdings neither in api nor on the console but orders listing does shows the stocks that I have purchased. Is holding section updated next day or something?
You will be able to see these placed orders same day on Order book.And next day on holdings.
You can get complete list of orders using retrive order's API, check the documentation here.