I explain the context:
I have a strategy that if it has only one open position, and this goes into drawdown of "x" pips, this opens a second position in the same direction with tp "y" (a number saved in a variable) going, in addition, to modify the tp of the first position putting it at the same price level as the tp of the second position just created. (see the first screenshot)
It works very well on the AlgoWizard, but I can't say the same thing about MT4/MT5, where, the TP of the first position is not changed and stays in place instead of going to the level of the second tp. (I attach screenshots to make everything clear).
I repeat that on AlgoWizard it works excellently, I attach screenshots of some operations that confirm this.
So I think there is a bug somewhere.
I have attached the .sqx file so you can check it yourself, if you export the source code to mt4 or mt5, you can do a backtest there to see it happening.
Status changed from New to Fixed
Attachment Example.sqx added
Attachment Capture.jpg added
I have checked the issue. I have updated your Example.sqx to let it works the same with MT5/MT4. Due to behaviour in MT5/MT4, we need to do some checking when entering the 2nd trades and update the SL/TP. The changes is in "2 Entry Buy".
Based on the added checking, it works correctly in MT5 now.
Thank you.