How to Cancel or Exit a Bracket Order,Cover Order and Regular Order in KiteConnect - Python


Follow this Video for Proper Instructions then Exactly follow Below for code Input:



from kiteconnect import KiteConnect
import csv
import pandas as pd

api_key='xxx'
api_secret='yyy'
kite=KiteConnect(api_key=api_key)
kite.set_access_token('zzz')
#after placing this order just comment
##OD1=kite.order_place('NSE','YESBANK','BUY',1,validity='DAY',trigger_price=293,variety='co')
ko=kite.orders()
ko=pd.DataFrame(ko)
print(ko)
OID=int(ko['order_id'][4:5])
POID=int(ko['parent_order_id'][4:5])
print(OID,POID)
print(kite.order_cancel(order_id=OID,variety='co',parent_order_id=POID))