Hmm, not to split hairs, but aren't we talking about the same thing
really? The gist of my post was to create a central place where
things
would get coordinated. It looks like you needed to do more than
Yah, we settled on the final solution, one program deals totally with
tws, other programs talk to it. An extra layer, but, isolates issues
cleanly.
Thanks for the info about the re-assignment of id's. I can see this
is
going to be one of those "10% effort on the real project, 90%
effort on
spelunking TWS" deals.
Well, it was befuddling intially, we got a lot of issues that
appeared at some times, and not others, and it took a while going
thru detailed execution logs, before we nailed down the exact causes,
but I think we have it now.
Get a methodology for safe order ids in place first. Then firmly
enforce this rule, everywhere. NEVER NEVER NEVER touch an order
between the call to place it, and the callback on order status. Dont
change it, dont cancel it, dont touch it. This is especially
important on something like a trail stop, where the stop condition
can be changing fast. This of course introduces a side effect, what
if the callback never comes ? Add timeouts, and more validation.
I will say this, the demo account is a godsend, and makes this whole
platform 'wonderful' from a programming perspective. It's got
quirks, but we can validate at zero cost. I've done this for another
client, using a different broker, where no test accounts were
available. A test run to validate a specific condition handler, was
a planned item, with an associated cost, because it entailed actually
taking a position in the market, knowing in advance, the goal was to
create a loss, to validate program execution. With IB, we can be
fully validated in advance.