I don't think your idea with two client connections will work. ExecutionCondition decisions are most definitely made within IBKR's infrastructure and not by TWS/IBGW. And at that point, IBKR is only concerned about accounts and orders regardless of how many client connections to TWS/IBGW exist.
?
We don't know all your requirements, but wouldn't a simple order attachment due the trick? You'd attach the order you want to trigger upon execution of the BUY order to the BUY order via parentId. Just like hedge and bracket orders. The child order will not become active until the parent (BUY) executes.
?
闯ü谤驳别苍
?
?
On hu, Jan 9, 2025 at 07:56 AM, Neal Young wrote:
toggle quoted message
Show quoted text
I have a question about conditional orders, where the condition is an execution condition, per
?
?
?
The documentation says that the condition is defined by giving a
symbol, an
exchange, and a
security type, and that the condition is met "
whenever a trade occurs on the specified product at the given exchange." Per other discussions here (e.g.
闯ü谤驳别苍's comment) I assume that the trade must be a trade in the current account (one that would trigger an execDetails message).
?
Here's my question:
?
in the case that I have two standing orders for the symbol, namely a buy order and a sell order, is it possible to have the condition trigger only when the buy order executes (and not when the sell order executes)?
?
(I don't see how, although I did think of one possible workaround: have two separate processes, each with its own connection to TWS, one managing the buy order, the other managing the sell order. ?Then (perhaps?) the execution condition set by the process that placed the buy order would only be triggered if the buy order executes. ?I don't know if this would work (I haven't tested it). ?I don't really want to resort to this, as having two separate processes, each with a separate connection to TWS, would complicate my code quite a bit.)
?
Thanks,
?
Neal