Crude Options Instrument Expired or Does Not Exit Error

prasadmchury
Hi Everyone,
I am new to this community. For Algorithmic trading in Crude, as a first step I am trying to place BUY order for MCX:CRUDEOIL24APR7100CE @ CMP. I am getting "The instrument you are placing an order for has either expired or does not exist."
I am able to get CMP using quote method for same instrument. Below kite.place_order details where symbol is set to MCX:CRUDEOIL24APR7100CE:
order_id = kite.place_order(
variety = kite.VARIETY_REGULAR,
exchange = kite.EXCHANGE_MCX,
tradingsymbol = symbol,
product = kite.PRODUCT_NRML,
transaction_type = kite.TRANSACTION_TYPE_BUY,
quantity = quantity,
order_type = kite.ORDER_TYPE_LIMIT,
price = strike_cmp
)
Tagged:
  • MAG
    MAG edited April 10
    How did you determine that the value for tradingsymbol should be MCX:CRUDEOIL24APR7100CE?

    Read the documentation carefully. When you ask for a quote the symbol is given as "exchange:tradingsymbol" format. Thats because one can ask for a quote for multiple instruments at one go.

    However in place_order method there are separate fields for exchange and tradingsymbol so when you have set your exchange to kite.EXCHANGE_MCX your tradingsymbol should be CRUDEOIL24APR7100CE instead of MCX:CRUDEOIL24APR7100CE.
  • prasadmchury
    Thanks MAG for quick response. That was of great help.
  • MAG
    All I would say in response is if you are new to api based trading then spend some time to read the documentation and FAQ's carefully. Most of your queries would already be answered there.
    Then when you start coding, look at sample code and first start by copying sample code and modifying it.
    That will help avoid a lot of these syntax errors.
  • prasadmchury
    Thanks for suggestion MAG. I came across one of the article in this forum which mentions about "https://kite.trade/forum/discussion/1994/a-curated-list-of-things-related-to-kite-connect-api#latest" URL to find latest document. Is this right place to start?
  • MAG
    Read the first four pinned posts on the forum.
    1. Changes to per day order limits
    2. FAQs on Pykiteconnect(Specific to python client)
    3. Frequently asked questions(FAQs)
    4. A curated list of things related to Kite Connect API

    Out of these number 2 is optional if you are not using python.
    Read these four in detail. Don't skip over anything.
    I know it looks like a lot of reading. But that's what is needed if you want to learn all details about the API and learn to use it effectively. There are no shortcuts.
  • prasadmchury
    Thanks MAG for all your guidance. Appreciate it very much.
This discussion has been closed.