I could able to place an order but could not able to exit the opened position. below is the code i am using to place the order: orderid_buy_temp=kite.place_order(tradingsymbol=instru_name[g],exchange='NSE',quantity=quant[g],variety='regular',transaction_type='BUY',order_type='MARKET',product='MIS',validity='DAY')
to exit above order: kite.cancel_order('regular',orderid_buy_temp)
got it thanks Rakesh for clarification. And got the answer to another question that why my next sell is executed but not showing in the positions. it might be clearing the previous buy order not creating the new sell order.
Exit of open position and Cancel of pending order is different.To exit an open position,you need to place sell order, as shown here.To cancel an pending order, check this part of documentation.