com.zerodhatech.kiteconnect.kitehttp.exceptions.InputException

sara_u
Hi there ,

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;
}

please let me know Ami doing something wrong here .
I am referring to https://kite.trade/docs/connect/v3/orders/#placing-orders

your help is very much appreciated !!
  • sujith
    Can you let us know what is the exception message? You can take a look at the structure here.
  • sara_u
    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 :)
  • sujith
    The description is inside the exception object's message. You just need to print and check.
Sign In or Register to comment.