Download MetaTrader 5
To add comments, please log in or register
Use MQL5 Cloud Network. Test robots at a super speed!
iExpertAdvisor
13
iExpertAdvisor 2014.11.07 17:16 

On build 711, if I compile an EA using the command line compiler mql.exe:

1. The EA will not appear in the experts folder unless the terminal is restarted

2.  Even after the restart, the EA is grayed out can not be attached to a chart.

 NOTE:  This is not the normal "gray out" when an EA has not been compiled. It appears to be a little different.

When you double-click the EA, the Experts tab reads "Cannot open file XXXX.ex4 [2]"

If you open the MetaEditor and compile the EA, everything works fine.

Has anyone else seen this? I'd like to be able to build with mql.exe and run the EA without opening the MetaEditor.

Thanks for any help. 

Carl Schreiber
5952
Carl Schreiber 2014.11.07 19:30  
iExpertAdvisor:

On build 711, if I compile an EA using the command line compiler mql.exe:

1. The EA will not appear in the experts folder unless the terminal is restarted

2.  Even after the restart, the EA is grayed out can not be attached to a chart.

 NOTE:  This is not the normal "gray out" when an EA has not been compiled. It appears to be a little different.

When you double-click the EA, the Experts tab reads "Cannot open file XXXX.ex4 [2]"

If you open the MetaEditor and compile the EA, everything works fine.

Has anyone else seen this? I'd like to be able to build with mql.exe and run the EA without opening the MetaEditor.

Thanks for any help. 

If you save or compile (I don't know exactly) another file this might have been saved but not compiled and then you can't start is unless you specifically compile it again - it's meant as feature I guess!
iExpertAdvisor
13
iExpertAdvisor 2014.11.07 20:41  
OK, so maybe it's a timestamp issue.  Thanks for the hint, I'll look into this and post back.
iExpertAdvisor
13
iExpertAdvisor 2014.11.07 21:28  

Nope - not a timestamp issue. It seems an EA must be built using the MetaEditor - and/or whatever process builds EAs when the platform is opened and there is an mq4 file, but not an ex4. (Same process runs when you right-click refresh on the EA menu in the platform).

 Strange, because I thought MT was supporting the command line compiler ... it seems like it is useless at this point. 

Carl Schreiber
5952
Carl Schreiber 2014.11.07 21:53  
You can't compile any more from the command line? How did you try that?
iExpertAdvisor
13
iExpertAdvisor 2014.11.07 22:05  

OK, figured it out. You need to pass the mql compiler (mql.exe) the correct working directory, then it works OK.  Here is an example:

mql.exe  /i:"C:\Program Files (x86)\FXCM MetaTrader 4\MQL4\Experts"   /mql4   myTestEa.mq4

It's all about the /i command.

I hope this helps somebody ...

To answer your question, you can compile OK - it builds and creates an ex4, but the EA is grayed out if you don't pass the right "working directory".

This may be documented somewhere, but I did not see it. 

Carl Schreiber
5952
Carl Schreiber 2014.11.07 22:58  

Do you know about the new directory system of mt4?

Look at the terminal's option: File => Open Data Folder.

In case you have started the terminal in /portable mode it's easy - in your case I guess "C:\Program Files (x86)\FXCM MetaTrader 4\MQL4\Experts"

In mt4-standard-mode you should see a folder like: "C:\Users\cas\AppData\Roaming\MetaQuotes\Terminal\8232B25980EFCE21F0FE92E85200F661\MQL4\Experts"

At the bottom of this page you have the new file structure

/
To add comments, please log in or register