-
-
Notifications
You must be signed in to change notification settings - Fork 824
Bracket order with several take profit #694
Comments
Your orderId logic looks a bit off because if you manually increment Your last example looks like it should work, but you'll have a problem if only one take profit triggers at (shares/2) then the price collapses and your stop executes at (shares) because you'll end up short (shares/2) instead of flat like you probably expect. |
Hello @mattsta! |
There's not a "simple" way for IBKR to fix the problem of multiple take-profit at different levels also with a full remaining quantity stop out condition. Basically, you'd need to write a custom system to watch your trade executions (add a It's not easy to automate multiple partial take profit orders like that, but it can be done if you track all the edge cases. |
Hello,
I’m trying to set a bracket order, and I want to place a parent order with several take profits, each one with different targets. To do it, I place 3 bracket orders, but when the first one is filled, I get the error 201-cancelled order ‘you cannot have both sides of the contract…’.
this is the code I run:
The lmtPrice and auxPrice should be changed once the first parent order has been filled.
I think maybe I could change the order as it follows:
or maybe like this:
Has somebody got any idea how to set this order properly?
thank you very much
The text was updated successfully, but these errors were encountered: