On Trade issue
-
I think there was a bug in "modify stops" some weeks ago, maybe because of that you needed to set TP.
I am testing it now and I saw the problem 2-3 times, but then it disappeared and I don't know why

-
Hello @fxDreema
I am running your simple EA with one of my MT5 demo accounts and the behavior is the same as I got. When the #11 is closed, there is no SL move and the TP of the #12 has been changed to 0.00000. Take a loot at the picture

Then, we have different issues:
-
SL has not been modified as expected. There is no error logged in the journal. TP1 is 5 pips away from the OpenPrice and the broker does not have a minimum SL.
-
TP has been modified to 0.00000 as I got sometimes when "No change" option is set for "modify stops" block. For this reason I was using a variable to keep the TP of the trades unchanged.

Thanks for your support on this issue.
-
-
Hi @fxDreema
Here you have another example with different result

In this case the EA is running in a demo account of the same broker. It is not the same account than the one of the example above but it is supposed that both should have the same behavior.
It seems that the EA behavior was as expected in three trades but not in the lastest one. I am running the EA alone. In the example above, the EA was added to an EAs portfolio in the same client. This could mean that the issue might be related to the broker or the platform. Because the code is the same in both cases but now we are getting better behavior.
Anyway, it is good that @fxDreema is investigating the issue.
Thanks
-
Hi @fxDreema
Here you have a new example with a behavior not as expected

Then, while you get the result of your investigation, it seems that the issue might be related to the broker &/or the platform because it seems as if the order to modify the SL after "Position closed" detection was not sent.
Thanks
-
Is the problem still present, because few days ago I uploaded some update? The problem was not very easy to investigate and I'm not sure what else could be wrong now. There was a problem in the function where I detect the type of "Trade" events. Basically I count the number of orders, deals and positions and decide whether something new was created or removed. MetaTrader 5 is unfortunately very very confusing and every time I feel that I'm hacking it instead of using the rules from its documentation. Everything is very strange. These problems happened because outside the Tester, when you are doing "modify" of a position, the count of orders changes few times... and this never happens in the Tester, something that I never knew.
But for you, I think that you better make the EA with partial close instead of these rules.
-
Hi @fxDreema
Thanks for helping.
I will compile again the EAs in order to check if the behavior is the same with the updates and I will let you know.
Yes, I do. I am working in building a similar EA with the partial close.
I encourage you to continue investigating the issue because I found very useful and easy to work with "OnTrade" section of the builder.
-
Today I uploaded few fixes again
-
Thanks @fxDreema
I will compile again the EAs to check out their behavior.
Working with Partial Close works pretty well and I am getting similar results than using "OnTrade" conditions to move the SL.
Go on with your hard work improving the builder.