For example, if I have something like this:
Code: Select all
ref2=IB_PlaceOrder("sell",contracts,stop,"stop","gtc",myoco);
And the price action is moving in my favor. I would like to either tighten my stop, or do a trailing stop. I looked through all the "IB_" commands, and I see nothing that takes a reference and then modifies it with a new value.
I could probably just cancel the order, then create a new one. But it gets a bit messy since I have also a target limit order set as part of an OCO group. So I would have to cancel all, then re-build both. And if I want to do this on every bar, just seems a bit wasteful...