I want to create a bracket order, which is structured just like the bracket order in TWS.
In picture 1 you can see that the bracket orders will be transmitted only if the main buy order is filled. But the orders are ready in TWS.
I want to know how can I make a strategy that generate a LIMIT buy order but before it is executed it has attached to it a stop order and I can see it waiting in TWS.
The logic for this is: if it is not waiting in TWS , if a connection problem occurs, I will be left off with a buy order without a stop attached to it.
can you please give me example a simple code on how it is done?
thank you. if needed I will explain further.
Comment