I have a 5 minutes timeframe strategy which use OCO limit orders to open a position in auto trading AA mode.
The strategy generates a "buy" and "sell short" order simultately (dummy code of the strategy below) :
Code: Select all
If MarketPosition = 0 and Longcondition and C > EntryprL then begin
Buy("Limit-Long-Position") Numbershares shares next bar at EntPrL limit;
end;
If MarketPosition = 0 and Shortcondition and C < EntPrS then begin
Sell short("Limit-Short-Position") Numbershares shares next bar at EntryprS limit;
end;
The limit price is updated in the strategy order monitor but it is not updated in IB. I need to manually cancel the orders in order to generate a new bunch of orders with the updated limit price.
I guess it is not a programming issue because it works well in TS but it might comes from a MC or IB parameter.
Could someone please tell me how to resolve the issue?
Many thanks in advance.