hey can someone tell me how to revrse order in python for eg; if reliance is trading at 2000 and i buy reliance for upside target but if it went against me and started falling how to quickly reverse the order my existing Order get square off and new trade initiated on sell side with single click
call order_history(for placed buy order)
suppose you stored buy order history in ord_details accordingly place sell order from that details
squareOff_order = kite.place_order(variety=kite.VARIETY_REGULAR, exchange=ord_details['exchange'], tradingsymbol=ord_details['tradingsymbol'], transaction_type=kite.TRANSACTION_TYPE_SELL, quantity=ord_details['quantity'], product=kite.PRODUCT_MIS, order_type=kite.ORDER_TYPE_MARKET)
newSell_order = kite.place_order(variety=kite.VARIETY_REGULAR, exchange=ord_details['exchange'], tradingsymbol=ord_details['tradingsymbol'], transaction_type=kite.TRANSACTION_TYPE_SELL, quantity=ord_details['quantity'], product=kite.PRODUCT_MIS, order_type=kite.ORDER_TYPE_MARKET)
hope this helps