The instrument you are placing an order has either expired or does not exist

sriramshankar
Hi,

I am using the Python KiteConnect API to short a Nifty Options. The python code that places the order is:
try:
order_id = kiteConnect.place_order(
variety=kiteConnect.VARIETY_REGULAR,
exchange=kiteConnect.EXCHANGE_NFO,
tradingsymbol="NIFTY23420APR17650CE",
transaction_type=kiteConnect.TRANSACTION_TYPE_SELL,
quantity=50,
product=kiteConnect.PRODUCT_NRML,
order_type=kiteConnect.ORDER_TYPE_MARKET,
validity=kiteConnect.VALIDITY_DAY
)
print("Order ID: " + format(order_id))
except Exception as e:
print(str(e))
Running this code results in the following error:
The instrument you are placing an order for has either expired or does not exist.

I have:
1. Checked the instruments list and see this instrument is set to expire today. But has not expired yet.
2. I am able to place orders for options whose expiry might be a week away.

I have checked the relevant documents and it seems to be OK. Any help on this would be most welcome.
This discussion has been closed.