MQL4 - automated forex trading   /  

Forum

Login | Register | Language: ru cn en
Forget Outdated Indicators and Buy Latest Ones in MetaTrader Market

Compiling without using the Editor in MT4 -SOLVED-

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
337
meikel 2010.01.05 22:32
 

out there are a lot of very good editors, with a lot of features, more than the build in MQL4 Editor.

it is a bad idea and a lot of work to modify the editor to make it as good as all the others out there.

my suggestion is, to provide the compiler as standalone exe file, this should be easy to establish, or, call the editor with switches like /compile /file=test.mq4

so everyone can use its favourite editor and compile mq4 files directly from the favourite editor.

as mql5 is out now, but it is not liked very much for some reasons from many programmers/traders,

i would be very pleased if the MT4 team makes my suggestion avaiable at MT4 too.

i think MT4 will be used at least until 2012, and i think its not more than some hours to make the compile function avaiable as a standalone exe.


greetings, meikel

 
Ten Basic Errors of a Newcomer in Trading

Ten Basic Errors of a Newcomer in Trading

There are ten basic errors of a newcomer intrading: trading at market opening, undue hurry in taking profit, adding of lots in a losing position, closing positions starting with the best one, revenge, the most preferable positions, trading by the principle of 'bought for ever', closing of a profitable strategic position on the first day, closing of a position when alerted to open an opposite position, doubts.

avatar
434
Ruptor 2010.01.05 22:57 #
 

Just a suggestion but you could have the file open on both editors and just switch to compile. Most people use visual C++ to generate DLLs for the complex part of the EA code.


 
avatar
337
meikel 2010.01.05 23:05 #
 
Ruptor:

Just a suggestion but you could have the file open on both editors and just switch to compile. Most people use visual C++ to generate DLLs for the complex part of the EA code.


as far as i know the MT4 editor doesnt automatically reload a changed file,

i have to close it and reopen.

i compile my sourcecodes even after small changes to detect errors very early, even if i havent finished the changes i want to do.

thanks for your suggestion, but i have already done it this way, and this is no comfortable solution.

for the complex parts of code i prefer perl or php, really powerful languages.

C is only useful if you need speed. i use it for coding modules for www.synthedit.com

C is a boring language ;-)

 
avatar
Moderator
2029
gordon 2010.01.06 03:40 #
 
I looked into it in the past and gave up. But it might be possible... See: http://forum.mql4.com/16841
avatar
1131
jjc 2010.01.06 13:51 #
 
meikel:

my suggestion is, to provide the compiler as standalone exe file, this should be easy to establish, or, call the editor with switches like /compile /file=test.mq4

I may be missing the point but, as gordon is saying... the compiler is a standalone file: metalang.exe. For example, I routinely compile MQ4 code using a batch file which calls metalang.exe and then copies the ex4 into multiple installations of MT4. (I also compile using build 220 of metalang.exe: http://forum.mql4.com/22328.)

 
avatar
536
EADeveloper 2010.01.06 15:11 #
 
jjc wrote >>

I may be missing the point but, as gordon is saying... the compiler is a standalone file: metalang.exe. For example, I routinely compile MQ4 code using a batch file which calls metalang.exe and then copies the ex4 into multiple installations of MT4. (I also compile using build 220 of metalang.exe: http://forum.mql4.com/22328.)

Yes, me to. Call metalang.exe from batch or some function in your editor (dll for example). Need only two parameters to pass ... source file and destination file :-)

 
avatar
337
meikel 2010.01.06 16:03 #
 

oops.

i havent noticed that there is metalang.exe

non existing problem solved. ;-)

thanks!


for all others like me who also missed the metalang.exe file (the standalone compiler) here the summary:

copy metalang.exe from the installation directory into your experts folder (because of this you dont need to add a path to your filenames )

open a dosbox in the experts folder and type for example

metalang test.mq4 test.ex4 > test.log

this compiles test.mq4 to test.ex4 and writes errors in test.log

 
avatar
Moderator
2029
gordon 2010.01.06 17:24 #
 
Yeah, but the tricky part is to understand the log... It's undocumented. At the time when I was trying to do that I just didnt have the time to figure out all the error codes. Anyway, if u do that, then please share. Thanks!
 
avatar
9446
WHRoeder 2010.01.06 17:39 #
 

as far as i know the MT4 editor doesnt automatically reload a changed file,

Yes it does, I save, switch and press F5. no problem. I do edit in the mt4/experts folder if that makes a difference.

 
avatar
1131
jjc 2010.01.06 19:06 #
 
gordon:
Yeah, but the tricky part is to understand the log... It's undocumented. At the time when I was trying to do that I just didnt have the time to figure out all the error codes. Anyway, if u do that, then please share. Thanks!

It may depend on what you want to use the log/error codes for. If you just want to check for success/failure of the compilation, then %ERRORLEVEL% (i.e. the exit code from metalang.exe) will give you that. Zero for success; non-zero for failure. Non-critical warnings (e.g. redundant functions) leave the exit code set to zero.

 
avatar
337
meikel 2010.01.06 19:49 #
 


i just made a language file for Geany Editor, its not perfect.

i havent figured out how to do a special MQ4 file, so i modified the C definition file, it will override the default C file. simply copy it in the "geany installation/data" folder (filetypes.c)

thanks Cloudbreaker i havent had much work to get the keywords list for highlighting (Alphabetic Index of MQL4 Functions http://forum.mql4.com/28412)

additional the modified filetype_extensions.conf in the same folder mentioned above.

change the last line of filetypes.c to the path where your metalang.exe is, then relaunch geany and pressing F5 compiles as usual

here the last line, change the path to your metalang.exe

run_cmd="E:\Programme\MBT MetaTrader 4\metalang.exe" "%f"

Attached files:
  geanyomq4.zip  (3.47 KB)
 
Back to topics list   | 1 2  

To add comments, please log in or register