I use the following java client code to place multiple orders at different price in 5 secs interval, now only 3qty. The first one is accepted, but other fail with return message as null.
int qty = Integer.parseInt(qtyFld.getText()); double halfPerc = (stock.ltp/100) * 0.5; for(int i = 1;i <= qty;i++) { OrderParams orderParams = new OrderParams(); orderParams.quantity = 1; orderParams.orderType = Constants.ORDER_TYPE_LIMIT; orderParams.tradingsymbol = stock.name; orderParams.product = Constants.PRODUCT_MIS; orderParams.exchange = Constants.EXCHANGE_NSE; orderParams.transactionType = Constants.TRANSACTION_TYPE_BUY; orderParams.validity = Constants.VALIDITY_DAY; /** * First order starts at next support, and minus half perc multiles of that downwards */ double nextLevel = (i == 1)?stock.getNextSupport():stock.getNextSupport() - halfPerc * i;
orderParams.price = nextLevel;//stock.getNextSupport();//Double.parseDouble(limitPriceFld.getText()); orderParams.tag = "myTag"; //tag is optional and it cannot be more than 8 characters and only alphanumeric is allowed try { Order order = ZerodhaAlgo.kiteConnect.placeOrder(orderParams, Constants.VARIETY_REGULAR); System.out.println(order.orderId); }catch (KiteException ke){ System.out.println(ke.getMessage()); } try{ Thread.sleep(5000); }catch (InterruptedException ie){ ie.getMessage(); } }
Debug showed me it is the problem with tick size, so i changed it according to the nse guidelines and it is working alright now.
Thanks for the debug idea to find out the issue. Anyway if it helps here is the tick size as per nse, price is 250 to 5000, then 0.1, 5000 to 10000 it should be 0.5 and above 10000 it is 5.
Thanks for the debug idea to find out the issue.
Anyway if it helps here is the tick size as per nse, price is 250 to 5000, then 0.1, 5000 to 10000 it should be 0.5 and above 10000 it is 5.
Cheers/-