placeGTT throws InputException

fortunetrail edited July 26 in Java client
KiteConnect version: 3.2.1
Java version: 11.0.3

I've already bought 1 lot of NIFTY22AUGFUT (normal order).
Now I'm trying to place a GTT, stop loss order. Here's the code:

double ltp = this.getLtp();
triggerPrice = ltp - 4D;

GTTParams gttParams = new GTTParams(); = Constants.EXCHANGE_NFO;
gttParams.lastPrice = ltp;
gttParams.tradingsymbol = "NIFTY22AUGFUT";
gttParams.triggerPrices = new ArrayList(List.of(Double.valueOf(0D)));
gttParams.triggerType = Constants.SINGLE;

GTTParams.GTTOrderParams orderParams = GTTOrderParams();
orderParams.orderType = Constants.ORDER_TYPE_SLM;
orderParams.product = Constants.PRODUCT_NRML;
orderParams.quantity = ZerodhaTest.QUANTITY;
orderParams.transactionType = transactionType;

gttParams.orders = new ArrayList(List.of(orderParams));

gttParams.orders.get(0).price = triggerPrice;
gttParams.triggerPrices = new ArrayList(List.of(Double.valueOf(triggerPrice - 4D)));

GTT gtt = Misc.theInstance().placeGTT(gttParams);

When I execute, I get this exception:
at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.dealWithException(
at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.handle(
at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.postRequest(
at com.zerodhatech.kiteconnect.KiteConnect.placeGTT(
    You can catch and print the exception message or run javakiteconnect with debug logs on to know the root cause.
Sign In or Register to comment.