How to check restrictions on placing Bank Nifty and Nifty option orders?

Souvick
I was trying to place a buy order for BANKNIFTY23SEP45500CE through Python using kite.place_order(order_type=kite.ORDER_TYPE_MARKET, product=kite.PRODUCT_NRML). But I have faced an error saying "kiteconnect.exceptions.InputException: Buy orders are blocked for this strike price due to [open interest (OI)](https://support.zerodha.com/category/trading-and-markets/kite-web-and-mobile/articles/why-did-my-bank-nifty-option-order-get-rejected) limits prescribed by SEBI. You can exit existing positions or place buy orders between 45600 - 46300 using NRML orders and 41400 - 50600 using MIS (intraday). Position conversion from MIS to NRML is not allowed."

I can see the explanation in the link provided. Is there any way to check the restriction before placing the order?
Tagged:
  • vaibhavsharma13
    @Souvick this is not API problem. Same error will occur when you buy from kite app. Kite dont allow far away OTM options buying for some reason
  • sujith
    We don't have API for checking the allowed strike range. You will have to place order and check the range in error message.
  • Souvick
    @vaibhavsharma13 I am not saying this is an error.
    @sujith can there be any workaround? e.g. checking the OI's for Zerodha and what is in the market?

    This is part of the explanation: "SEBI regulations mandate an upper limit on the OI of each F&O contract at every broker, set at 500 crores or 15% (whichever is higher) of the total OI for that specific contract across the market. As Zerodha has a considerable number of active users trading index options, there are restrictions on buying OTM (Out of the Money) options for specific strikes to maintain OI limits within the allowed ranges."
  • rakeshr
    can there be any workaround?
    As @sujith mentioned above, either you need to place an order and parse the error for the allowed range or check here manually for the allowed range.
  • Souvick
    @rakeshr thanks. I will check it manually. Do you update this once a day or can be updated anytime during the day?
  • rakeshr
    These ranges are updated multiple times a day, depending on the risk management requirement.
  • Souvick
    Souvick edited September 2023
    I got this error at 15:04:33 today. Though your website shows this is inside the range, I am still getting this error. Is not the website updated regularly?



    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /orders/regular HTTP/1.1" 400 492
    Failed to exit: BANKNIFTY23SEP45800CE. Reason: Buy orders are blocked for this strike price due to [open interest (OI)](https://support.zerodha.com/category/trading-and-markets/kite-web-and-mobile/articles/why-did-my-bank-nifty-option-order-get-rejected) limits prescribed by SEBI. You can exit existing positions or place buy orders between 45000 - 45700 using NRML orders and 40800 - 49900 using MIS (intraday). Position conversion from MIS to NRML is not allowed.
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /orders/regular HTTP/1.1" 200 None
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "GET /orders HTTP/1.1" 200 None
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /orders/regular HTTP/1.1" 200 None
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "GET /orders HTTP/1.1" 200 None


    Also the status message from the kite.orders() is showing this: Insufficient funds. Required margin is 209579.68 but available margin is 149638.50. Check the orderbook for open orders.
  • rakeshr
    Insufficient funds. Required margin is 209579.68 but available margin is 149638.50. Check the orderbook for open orders.
    This is funds-related error, not an OI limit error. OI limit error is as shown here.
  • Souvick
    Souvick edited September 2023
    @rakeshr i can see that. but that doesn't tie up with the actual error message I am getting from Kite in Python.

    On Python I see the OI error. but when I retrieve the kite.orders() it shows fund related error. also why the website is not updated regularly for allowed strikes? is there any better source to check, except placing an error.

    If I retrieve the OI data for particular strike from the depth using websocket, will it be accurate enough? i can compare this with the data on NSE's website.
  • sujith
    The OI restriction is on the broker and not the depending on the overall market. The RMS and OMS is a complicated setup currently. Hence it is not possible to provide an API. Currently, our RMS team update this allowed strike range from backend multiple times a day.
    Once we have our own OMS setup completely ready, we will be able to figure out a way to provide and API for allowed strike range.
    As of now, you will have to place order and check the range in the error message.

    If you receive 400 Input Exception then there won't be an entry in the orderbook. The order is blocked by our mini RMS. The orderbook entry will be created only if you get 200 http status for an order placement request.
    I think you are comparing two different orders here.
  • Souvick
    thanks for the clarification.
Sign In or Register to comment.