Set Profit Target bug(works on SQ but not in MT4/5)

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.

Attachments
Example.sqx
(4.34 KiB)
Screenshot 2023-01-23 alle 204127.png
(96.10 KiB)
Screenshot 2023-01-23 alle 205103.png
(107.19 KiB)
Screenshot 2023-01-23 alle 205948.png
(23.20 KiB)
  • Votes +3
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

ML
#1

officialmatteolaureti@gmail.com

23.01.2023 21:04

Task created

b
#2

bentra

24.01.2023 19:57
Voted for this task.
E
#3

Emmanuel

25.01.2023 14:56
Voted for this task.
g
#4

Lee Guan Chuan

07.02.2023 08:30

Status changed from New to Fixed

Attachment Example.sqx added

Attachment Capture.jpg added

Example.sqx
(5.88 KiB)
Capture.jpg
(295.56 KiB)
Hi,


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.


Votes: +3

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please