Experts grayed out if build via command line with mql.exe

 

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. 

 
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!
 
OK, so maybe it's a timestamp issue.  Thanks for the hint, I'll look into this and post back.
 

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. 

 
You can't compile any more from the command line? How did you try that?
 

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. 

 

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