OCO orders limit price update with IB  [SOLVED]

Questions about MultiCharts and user contributed studies.
Tibouss
Posts: 31
Joined: 26 May 2022
Has thanked: 7 times
Been thanked: 1 time

OCO orders limit price update with IB

Postby Tibouss » 10 Jan 2024

Hello,

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 strategy works perfectly in TS but when i use MC and IB the limit price is not updated after every limit entry price update (it occurs after almost every bar).
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.

User avatar
Kate MultiCharts
Posts: 597
Joined: 21 Oct 2020
Has thanked: 9 times
Been thanked: 148 times

Re: OCO orders limit price update with IB

Postby Kate MultiCharts » 11 Jan 2024

Hello Tibouss,

UPD: If you're using a MultiCharts version older than MC 14 Release 9, I'd recommend upgrading as we implemented fixes for the OCO group order modification when using IB TWS/Gateway newer than 10.22.1 in Release 9

If that doesn't help, please send us a Feedback report so that we could check the reported behaviour.
You can send a report via the main MultiCharts window → Help → Feedback.
In the Feedback window select the following options:
  • Attach a screenshot;
  • Attach log files…;
  • Snapshot of the current MC setup;
  • Open workspaces…;
  • Upload collected data to Help Desk;
    uncheck other options and click Send.
Some general info:

If EntPrL and EntryprS get changed from the script, the price should update. Otherwise, orders on the IB end are not supposed to be modified.
If there were any issues with order modification, the reason why IB refused to modify the orders should be specified in File → New → Order and Position Tracker → Logs tab.

Most likely, the behaviour is not related to OCO groups, but if you believe that is is, you might want to try using emulated OCO groups instead of native by unchecking the Use Native OCO Group box in the IB broker profile settings.

Tibouss
Posts: 31
Joined: 26 May 2022
Has thanked: 7 times
Been thanked: 1 time

Re: OCO orders limit price update with IB  [SOLVED]

Postby Tibouss » 16 Jan 2024

I tried with the latest version of Multicharts and it works well.

Thank you very much Kate!


Return to “MultiCharts”