Can I write order placing code in this way

nayan_nandi
I'm always trying to place bracket_order but, some time zerodha accept bracket_order
and some time not. That's why i want place bracket_order first but if the order placing is
rejected then I want to place cover order.

So can I write the code this way...
if (condition True):
try:
kite.place_order(tradingsymbol="ACC",
price=700,
variety=kite.VARIETY_BO,
exchange=kite.EXCHANGE_NSE,
squareoff=707,
transaction_type=kite.TRANSACTION_TYPE_BUY,
quantity=10,
stoploss=693,
order_type=kite.ORDER_TYPE_LIMIT,
product=kite.PRODUCT_BO,
disclosed_quantity=10)
except:
kite.place_order(tradingsymbol="ACC",
transaction_type="SELL",
variety="co",
exchange="NSE",
quantity=10,
product="MIS",
order_type="MARKET",
trigger_price=693,
disclosed_quantity=10)
  • sujith
    You need to read the Kite Exception status code and message before retrying with an alternative order type.
    If bracket order is allowed someday and you get 503 in some scenario then you will end up placing double order.
Sign In or Register to comment.