1 (edited by Lagoons 2018-10-31 22:30:43)

Topic: Updated EA in MT4 traded still like the previous version?

Hello,

I expericenced a weird issue I've optimized an EA last month and and replaced the older version on MT4.

It performed mediocre to say at least. So now I've analysed the performance and to my suprise the result was that the trades were not the result from the updated EA but from the older version!?

But the weird thing is, at that time I already attached the updated EA onto the chart, I could easily check it in my MT4 logs.
And the trades were current trades no older ones.

How can this happen? The only thing I did was to make sure that the updated EA had still the same magic number like the older one, to manage older trades.

Does anyone know what may have happend and how I can prevent this, cause I have no clue?

Re: Updated EA in MT4 traded still like the previous version?

Did you reset the expert parameters?
https://i.imgur.com/mRsTRqW.png

Vinicius Pereira, Portuguese Support.
Improve your trading with my strategies & signals on MQL5. High success rate & many followers. Check them out & join my EAS telegram group for updates.

3 (edited by Lagoons 2018-10-31 22:57:21)

Re: Updated EA in MT4 traded still like the previous version?

Did I have to?

No, I just replaced the MQ4 file and it had the new settings on board or did I get this wrong?

Best regards

Re: Updated EA in MT4 traded still like the previous version?

Yes Lagoons you have too, this is "in my opinion" a MT4 and MT5 caveat
When the software see a previous tested magic number it will keep the last backtest settings

But maybe this is not the solution for your problem, do you mind to try it please?


Best regards

Vinicius Pereira, Portuguese Support.
Improve your trading with my strategies & signals on MQL5. High success rate & many followers. Check them out & join my EAS telegram group for updates.

Re: Updated EA in MT4 traded still like the previous version?

Of course, I'll try this.

But just to make clear, I've talked about live trading not backtesting.

So if I've resetted the input is it safe to change the EA's magic number to the previous one?

And if I want to make sure that an EA won't open more trades but still manage the old ones, could I just change e. g. Amount for new position to 0.0?

Best regards

Re: Updated EA in MT4 traded still like the previous version?

I'm not clear about what you are trying to do...

If you've modified / improved an EA then you should NOT change its magic number -- otherwise, it simply becomes a different EA.

When you modify an EA you must recompile the *.mq4 to a *.ex4.  Sometimes, there may be a compile error that you didn't notice -- in which case the old *.ex4 will still be present and will be the one that is used.

MT4 keeps the previous version of the EA in memory and will keep using it -- unless you force it to let go and look for a new version.  There are two ways of doing this:
a. Exit and relaunch MT4
b. In the Navigator window right-click "Expert Advisors" and select "Refresh".  This will force MT4 to unload any EA it currently holds in memory. 

After performing (a) or (b), when you attach your EA to a chart then it should be the new one.

What I sometimes do is add an additional "Print" statement in the OnInit() function as a sanity check and change the version number string -- e.g.
Print("EA 150063001 -- version 1.0.1");

Re: Updated EA in MT4 traded still like the previous version?

Hello,

I've probably was not clear enough what I did.

I've built a strategy with FSB and attached it on a chart in MT4, after a while I omptimized the strategy with FSB, exported the EA and replaced the old version with it (just different settings) in MT4.
Additionally I changed the magic number to the previous one.

Somehow the EA used the old settings, nevertheless the EA showed in the inputs tab the correct ones.

And I cannot explain how this could have happened.

Re: Updated EA in MT4 traded still like the previous version?

And of course I gave the updated EA a different name than the previous version.

Re: Updated EA in MT4 traded still like the previous version?

Somehow the EA used the old settings, nevertheless the EA showed in the inputs tab the correct ones.

This is a serious issue of MT. Please report it to MetaQuotes.

The EAs produced by FSB Pro and EA Studio are 100% native MQL files, which compiles without errors and warning. Please check the EAs output in the MT's Expert output for any suspicious messages.