Option Kite Placing error"kiteconnect.exceptions.InputException: Instrument is invalid."

rajagopal
NIFTY205148400PE

order_id = kite.place_order(variety=kite.VARIETY_REGULAR,
tradingsymbol='NIFTY205148400PE',
exchange=kite.EXCHANGE_NSE,
transaction_type=transaction_type,
quantity=75,
order_type=kite.ORDER_TYPE_MARKET,
product=kite.PRODUCT_CNC)
  • sujith
    You need to print the exception message and check. You can check out the exception structure here.

    One of the guesses is you seem to be sending a wrong product type. You need to send NRML, CNC product is only for the equity segment(delivery).
  • rajagopal
    I am getting the same error...

    try:
    order_id = kite.place_order(variety=kite.VARIETY_REGULAR,
    tradingsymbol=tradesymbol,
    exchange=kite.EXCHANGE_NSE,
    transaction_type=transaction_type,
    quantity=75,
    order_type=kite.ORDER_TYPE_MARKET,
    product=kite.PRODUCT_NRML,
    validity=kite.VALIDITY_DAY)

    logging.info("Order placed. ID is: {}".format(order_id))
    except Exception as e:
    print (e)
    logging.info("Order placement failed: {}".format(e.status))
    logging.info("Order placement failed: {}".format(e.message))
    logging.info("Order placement failed: {}".format(e.error_type))


    File "/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/connect.py", line 326, in place_order
    File "/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/connect.py", line 701, in _post
    File "/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/connect.py", line 766, in _request
    kiteconnect.exceptions.InputException: Instrument is invalid.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/kite_order_place.py", line 65, in
    zerodhautility.kite_place_order(kite,option,'BUY')
    zerodhautility.py", line 30, in kite_place_order
    logging.info("Order placement failed: {}".format(e.status))
    AttributeError: 'InputException' object has no attribute 'status'
  • rajagopal
    @sujith can you take a look at this? I need to close this asap. Please do the needful.
  • rajagopal
    resolved @sujith .. have given the exchange=kite.EXCHANGE_NSE, instead of NFO
This discussion has been closed.