Same EA in MQL5 and MQL4
-
I created my MQL 4 EA in MQL 5. I didn't convert anything, I just did the (hard work) all over in MQL5. For some reason the MQL5 EA will not Terminate. 2 pictures below for clarification. Settings in both EA's are the same. Do I need to understand something more about MQL 5???


-
Update with journal. Looks like it starts selling again before the function TERMINATE on trade is called. When selling again it means a trade is in play and the terminate function can't execute. Again its the same EA as in MT4
which operates perfectly. -
Below the input fields. Partial closes not visible are 0.4>0.2>0.1 and 0.1 at full target. This all works perfect except terminate on trade.

-
Error is clear but no Idea how to solve this. The EA works good until full target gets hit. At full target the EA doesn't close the last 0.1 lot size of each trade and because of that the EA cannot Terminate. (small note: After hitting first target no more trades are allowed)

-
So I need to get used to MQ5 tester because just saw in History all trades did close which is not visible in operations. But that still doesn't explain why the EA does not terminate with "ON TRADE" settings.
