I have a situation where I put orders on both sides of the market using the unmanaged approach. I can have a situation where a long signal is generated that is "inside" an existing stop order for a short position.
When this happens, I need to bring my stop down to match the new entry order. When the original short position was filled, it may be with many partial fills and in OnExecution I submit a pair of OCO orders for the the execution quantity using the same 2 IOrder objects (short stop loss and short profit target).
If I then need to move all the stop losses down (as per above), does one call to ChangeOrder do this or do I need an array of IOrder objects, each one for the individual partial fills and then loop through the array and call ChangeOrder for each partial fill.
Is it better/possible to call ChangeOrder in OnExecution and amend a single stop loss order with the new quantity and would that in any way affect the other OCO (profit) order?
In summary, I can end up with many partial fills resulting in a series of stop loss orders all at the same price which I may then need to move, all to the same price. What is the best way to do this?
This is essentially the same issue you would have if you wanted to have a trailing stop. From the examples I have seen it appears that partial fills do not figure into a trailing stop scenerio.
Thanks,
Scott
Comment