You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm placing a parent order in my python app which includes an attached stop loss order. When I check in the TWS GUI, it shows the two orders, but it doesn't show them as attached the way it does when I place an order in the GUI with the attached bracket order interface. I think this is just cosmetic, but is there a way to do this?
parent_order=Order(
action="SELL",
totalQuantity=quantity,
orderType="LIMIT",
lmtPrice=option["bid"]
)
# Do not transmit the parent order yetparent_order.transmit=False# Define the stop loss (child) orderif (SL_multiplier>0):
stop_loss_order=Order(
action="BUY",
totalQuantity=quantity,
orderType="STP",
auxPrice=stop_loss_price,
parentId=parent_order.orderId
)
stop_loss_order.transmit=transmit# Place the orderstry:
trade=ib.placeOrder(contract, parent_order)
trade_sl=ib.placeOrder(contract, stop_loss_order)
exceptExceptionase:
logging.error(f"Error placing order: {e}")
returnNone
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm placing a parent order in my python app which includes an attached stop loss order. When I check in the TWS GUI, it shows the two orders, but it doesn't show them as attached the way it does when I place an order in the GUI with the attached bracket order interface. I think this is just cosmetic, but is there a way to do this?
Beta Was this translation helpful? Give feedback.
All reactions