Stoploss order - InputException

PrashantS
I have the following values in my OrderParams object just before kiteConnect.placeOrder():
OrderParams{
exchange='NSE',
tradingsymbol='CANBK',
transactionType='SELL',
quantity=20,
price=88.3,
product='CNC',
orderType='SL-M',
validity='DAY',
disclosedQuantity=null,
triggerPrice=88.3,
squareoff=null,
stoploss=88.3,
trailingStoploss=null,
tag='null',
parentOrderId='null'
}


I place the order like this:
kiteConnect.placeOrder(slOrderParams, Constants.VARIETY_REGULAR);

And I'm getting com.zerodhatech.kiteconnect.kitehttp.exceptions.InputException
on the placeOrder() line.

What am I missing here?
  • PrashantS
    Any updates on my problem?
  • enliyo
    Not sure what is the problem. Simple trick is to place same order in Kite and observe what kind of request it sends. Comparison may point to some missing field if there is any.

    You can observe the network requests in Chrome Dev tools.
  • PrashantS
    Thanks enliyo for pointing out how to inspect.

    Once I matched the requests, I was still getting an error. While trying to enable debugging logs, I learned a few more things.

    I am putting my learnings up here for the benefit of others -
    1. I was getting this exception in the kite logs - "20 quantity needs authorisation at the depository", related to https://kite.trade/forum/discussion/7813/important-new-authorisation-flow-for-cnc-equity-sells
    2. To enable logging, I had to change the KiteConnect constructor I was calling to one which has a boolean enableLogging
    3. Since I am also using selenium, enabling logging threw up runtime exceptions which were caused by OkHttp3 version conflicts between selenium and Kite libraries (this is even with a okhttp3 bom in place). I'm going to try and shift Selenium to a maven module of it's own, so that dependencies can have a level of separation.
Sign In or Register to comment.