Updating EA that is running?

 
Do I have to restart the whole MetaTrader if I want to update my EA that is currently running on an account? Or, is it enough if I just copy the new modified EA the the experts- folder, and compile it?
 

IME, if an EA that is running is recompiled, the new version will execute on next tick

-BB-

 
BarrowBoy:

IME, if an EA that is running is recompiled, the new version will execute on next tick

-BB-

Yes, absolutely. The EA will automatically uninitialize and then initialize.

If you use a deinit() function, you will find that a call to the UninitializeReason() function will return REASON_RECOMPILE.


CB

 

Hi Guys

Unfortunately I have had instances where things don't happen as they should and that goes for indicators too. Most likely the EA was executing when the compile was done. I am not sure exactly what happens but if the EA is being accessed when the compile is done you can see probably MetaEditor would be blocked from changing it. I would recommend removing the EA then reloading and load up the settings again that way you know things are right.

 
Ruptor wrote >>

Unfortunately I have had instances where things don't happen as they should...

Isnt that the truth!

I usually make a change in the visible Comments the EA posts to the screen to confirm that <something> has changed!

But this <make change but doesnt take effect> happens quite often with backtesting - I always do a Reset in EA Properties between changes to an EA and the next backtest or optimization

Seems the buffered copy of the EA isnt always updated and a Reset seems to bump the old copy out of memory...

FWIW

-BB-

 

"..I always do a Reset in EA Properties between changes .."

number of times I get caught out cuz forget is crazy numbers!!!

Reset really does the trick in many instances.

ya... Comment() + Print() equals visual reality check - lol

.

So right!

even if that "..<something>.." is unexpected - is great to see <something>...

:o)

 

Just to play safe, close the running EA first, then re-compile and drag it back onto the chart.. But I guess it depends on the changes you made to it.