Thanks for the suggestion, how would I put this MOC order within my bracket order, would this work?
Or do I not need to add a timecondition to an MOC order within this bracket?
# previous code replacing last part in bracket
# 3rd part: Sell Market order
moc = Order()
moc.orderId = opening.orderId + 3
moc.action = "SELL" if quantity > 0 else "BUY"
moc.orderType = "MOC"
moc.totalQuantity = abs(quantity)
moc.parentId = parentOrderId
moc.tif = "DAY"
timeCondition = TimeCondition()
timeCondition.time = timeswitch
timeCondition.isMore = True
moc.conditions.append(timeCondition)
bracketOrder = [opening, trailingStopLoss, moc]
return bracketOrder