How do I to refresh or update the Expert Advisor when change the .ex4? - page 2

 
Fernando Paiva:

 I want to refresh/update the EA I mean. For example, I have an EA version 1.0 and when I change it to 1.1 just coping to folder ...\MQL4\Experts  of terminal I would like it refresh/update on MT4 automatically even it running at the same time. 

I'm not sure if I am missing something here.

You have EA v1.0

Save and compile it as EA vCurrent. Use this version of the EA on your charts.

Save EA v1.0 as EA v1.1 and do your modifications. When you are happy with it

Save, replace and compile it as EA vCurrent

All charts are updated with the new version.

You may need to check if while modifying the code you have added or removed any inputs.

 
Fernando Paiva:

@Fabio Cavalloni I don't want to right click on EA menu on left side and then click to update after copy a file. I don't want to close/open the MT4 to it make the update/refresh the new file. I just wanna to force the MT4 reload the *.ex4.

If I need to do some critical bug fix I will do this manually but sometimes I did a little change and to me don't have any sense to do that even 'cause I have 50 MT4 running because I have 50 accounts to trade, so, think about to refresh/update 50 ex4 manually. Now you know why I want to do that.

I created a Java programa to copy the files to each folder, but now I want that MT4 refresh/update the *.ex4 automatically. 

Are there no way to force the MT4 refresh/update/reload or even read again the *.ex4 and then it works as the new file ? @Fernando Carreiro

An EA that work every X seconds triggering the refresh in the OnTimer function.
I don't know if triggering the refresh freezes platform for some seconds, if yes, it's bad, otherwise it will work.
 
Fernando Paiva:

@Fabio Cavalloni I don't want to right click on EA menu on left side and then click to update after copy a file. I don't want to close/open the MT4 to it make the update/refresh the new file. I just wanna to force the MT4 reload the *.ex4.

If I need to do some critical bug fix I will do this manually but sometimes I did a little change and to me don't have any sense to do that even 'cause I have 50 MT4 running because I have 50 accounts to trade, so, think about to refresh/update 50 ex4 manually. Now you know why I want to do that.

I created a Java programa to copy the files to each folder, but now I want that MT4 refresh/update the *.ex4 automatically. 

Are there no way to force the MT4 refresh/update/reload or even read again the *.ex4 and then it works as the new file ? @Fernando Carreiro

Using Win32 API messaging to interact with MetaTrader and using @Fabio Cavalloni instructions of "Right click on navigation panel, refresh", you should be able to accomplish that. Monitor file-times of ".ex4" files and then whena change is detected, apply the refresh.

 
Keith Watford:

I'm not sure if I am missing something here.

You have EA v1.0

Save and compile it as EA vCurrent. Use this version of the EA on your charts.

Save EA v1.0 as EA v1.1 and do your modifications. When you are happy with it

Save, replace and compile it as EA vCurrent

All charts are updated with the new version.

You may need to check if while modifying the code you have added or removed any inputs.

The OP is compiling the new version of the code offsite and then replacing the ".ex4" files on several hosts by just uploading the file directly to the folder. Since this is done outside of MetaTrader it continues to run the older ".ex4" code and does not automatically restart the EA with the new code. That is the problem that he is facing!
 
Fernando Carreiro:

Using Win32 API messaging to interact with MetaTrader and using @Fabio Cavalloni instructions of "Right click on navigation panel, refresh", you should be able to accomplish that. Monitor file-times of ".ex4" files and then whena change is detected, apply the refresh.

Monitor all files used can be a huge process. If refresh do not freeze platform in case of no file changed probably it can be called every X seconds without particular problems.
It need to be tested.
 
Fernando Paiva: Are there no way to force the MT4 refresh/update/reload or even read again the *.ex4 and then it works as the new file ? @Fernando Carreiro

As an extra note on my previous post to you, when one compiles new code on MetaEditor, MetaTrader automatically updates. So, if you can research which Win32 messages are being sent between MetaEditor and MetaTrader during that process, then you should be able to replicate that functionality to force MetaTrader to update when you upload those ".ex4" files to your hosts.

 
Fabio Cavalloni: Monitor all files used can be a huge process. If refresh do not freeze platform in case of no file changed probably it can be called every X seconds without particular problems.
It need to be tested.

Windows already has a built-in mechanism for detecting changes to folders and files that can be leveraged without putting any more strain on the CPU or other resources. It is used for example for syncing files on OneDrive, Dropbox, etc. Since he will be doing this from outside of MetaTrader it can easily have the monitor run as a separate task or service.

 
Fernando Carreiro:
The OP is compiling the new version of the code offsite and then replacing the ".ex4" files on several hosts by just uploading the file directly to the folder. Since this is done outside of MetaTrader it continues to run the older ".ex4" code and does not automatically restart the EA with the new code. That is the problem that he is facing!

Oh I see, I missed that as it is in a later post.

 
Fernando Paiva #:

@Fabio Cavalloni I don't want to right click on EA menu on left side and then click to update after copy a file. I don't want to close/open the MT4 to it make the update/refresh the new file. I just wanna to force the MT4 reload the *.ex4.

If I need to do some critical bug fix I will do this manually but sometimes I did a little change and to me don't have any sense to do that even 'cause I have 50 MT4 running because I have 50 accounts to trade, so, think about to refresh/update 50 ex4 manually. Now you know why I want to do that.

I created a Java programa to copy the files to each folder, but now I want that MT4 refresh/update the *.ex4 automatically. 

Are there no way to force the MT4 refresh/update/reload or even read again the *.ex4 and then it works as the new file ? @Fernando Carreiro

Hi Fernando.

Have you found the solution to refresh experts list?

I faced the same problem when moving EA from one account to other and need automatically start it there.

 

Hi guys, I am facing the same problem. Everytime I compile externally an mq4 file and copy to the \Experts folder I have to manually click/focus on Metatrader4, click/focus  on the "Navigator", right click on the node tree "Experts" and click on the "Refresh" menu option.  4 clicks repeated at least 50 times per day.

That is really annoying to develop for Metatrader.

We need a solution to pass a parameter to the "terminal.exe" or "metaeditor.exe" 

At this moment I can compile using the command below:

C:\MT4\metaeditor.exe /compile:C:\mql\ /log:C:\mql\compile.log

I use Gradle to compile and to copy the files to the \Experts folder automatically. 

Then I need something like this:

C:\MT4\terminal.exe /refresh

It should be so simple to implement this.

An alternative solution should be metaeditor.exe copy the compiled file automatically to the correct folder and communicate the Metatrader (terminal.exe) to refresh the EAs and indis.

Fernando Carreiro, could you please speak to the OP team about it ?
Reason: