I am trying to create a market order and , this is the order cod base I am using I'm getting an input exception .
Exception : com.zerodhatech.kiteconnect.kitehttp.exceptions.InputException at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.dealWithException(KiteResponseHandler.java:54) at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.handle(KiteResponseHandler.java:20) at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.postRequest(KiteRequestHandler.java:85) at com.zerodhatech.kiteconnect.KiteConnect.placeOrder(KiteConnect.java:291)
Code Base : @NotNull private OrderParams getOrderParams(String niftyStrikeInstrument) { OrderParams orderParams = new OrderParams(); orderParams.quantity = 150; orderParams.orderType = Constants.ORDER_TYPE_MARKET; orderParams.tradingsymbol = "NIFTY20JUN9100PE"; orderParams.product = Constants.PRODUCT_NRML; orderParams.exchange = Constants.EXCHANGE_NFO; orderParams.transactionType = Constants.TRANSACTION_TYPE_SELL; orderParams.validity = Constants.VALIDITY_DAY; //orderParams.price = 122.2; //orderParams.triggerPrice = 0.0; //orderParams.tag = "myTag"; //tag is optional and it cannot be more than 8 characters and only alphanumeric is allowed return orderParams; }
I got the error by debugging into the class, I was trying to test off-market hours and it throws this exception. the exceptions could be more descriptive