MIS / BO / CO orders are blocked. Try using CNC or NRML.

pruthvik
pruthvik edited February 2021 in Python client
Hi guys, I am new to algo trading,i am using Python for automating, today i got an error during placing an MIS order for a stock "MIS / BO / CO orders are blocked. Try using CNC or NRML.".

I want to use try and except for automatically place NRML order instead of MIS whenever i get this error.

Example code:

try:
kite.place_order(tradingsymbol=symbol,
exchange=kite.EXCHANGE_NSE,
transaction_type=kite.TRANSACTION_TYPE_BUY,
quantity=quantity,
order_type=kite.ORDER_TYPE_MARKET,
product=kite.PRODUCT_MIS,
variety=kite.VARIETY_REGULAR)
except __________________________________________:
kite.place_order(tradingsymbol=symbol,
exchange=kite.EXCHANGE_NSE,
transaction_type=kite.TRANSACTION_TYPE_BUY,
quantity=quantity,
order_type=kite.ORDER_TYPE_MARKET,
product=kite.PRODUCT_NRML,
variety=kite.VARIETY_REGULAR)


Question - What should i use after except to except only above error.?
  • rakeshr
    @pruthvik
    What should i use after except to except only above error.?
    "MIS / BO / CO orders are blocked. Try using CNC or NRML."
    Above exception is InputException. You can go through this documentation to know about all kiteconnect exception.
    You can handle above exception something like:
    from kiteconnect.exceptions import InputException
    try:
    # Place Order
    except InputException:
    # Handle exception
Sign In or Register to comment.