Place Bracket Order Utilizing Alice Blue Free API in Python







Open Alice Blue Trading Account Please Click Here.



Please Follow the Above Videos for Proper Instructions then go for the Code:


from login import *
from alice_blue import *

access_token=open('C:/Users/VIKASH/Desktop/alice/access_token.txt','r').read().strip()
alice=AliceBlue(username,password,access_token,['NSE'])
order_id=alice.place_order(TransactionType.Buy,alice.get_instrument_by_symbol('NSE','RELIANCE'),1,OrderType.Limit,
                        ProductType.BracketOrder,1440.0,None,5.0,3.0,None,None)
print(order_id)
#Cancel Bracket Order
cancel_order_id=order_id['data'][oms_order_id']
print(alice.cancel_order(cancel_order_id))