I have the code below - python code using ib_insync to connect and place a bracket order for a ticker. However, only the first order, the parent order, gets submitted. The child orders (target and stop loss) don't get submitted. I am a bit stumped and not sure where/what the error is?
from ib_insync import*
#create connection
ib = IB()
ib.connect(host='xxx.x.x.x', port=xxxx, clientId=1)
ticker_symbol = "CAN"
ticker_contract = Stock(ticker_symbol,'SMART','USD')
ib.qualifyContracts(ticker_contract)
ticker_bracket_order = ib.bracketOrder('BUY',100,8.51,8.68,4.26)
#place bracket order
for ord in ticker_bracket_order:
ib.placeOrder(ticker_contract, ord)