rishiswethan2

Cancel all orders

Jul 19th, 2019
934
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1.  
  2. def cancel_all_orders():
  3.     orders = kite.orders()
  4.     for order in orders:
  5.         # print(order)
  6.         if order['status'] == 'TRIGGER PENDING' or order['status'] == 'OPEN':
  7.             print(order['tradingsymbol'])
  8.             cancel_id = kite.cancel_order(variety=order['variety'], order_id=order['order_id'],
  9.                                           parent_order_id=order['parent_order_id'])
  10.             print('cancelled', cancel_id)
Add Comment
Please, Sign In to add comment