MQL4 - automated forex trading   /  

Forum

Login | Register | Language: ru cn en
Write an Article and Earn Money

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

 
VIDEO LESSON - Two Trading Mistakes Which Will Destroy Your Account
A lesson on two of the most common mistakes that traders make when trading the stock, futures and forex markets. One of the most common mistakes is sticking in a trade where you know you are right in your analysis, but the market continues to move against you. As the famous economist John Maynard Keynes once said: "The markets can remain irrational longer than you can remain solvent" Perhaps one of the best examples of this are those who shorted the NASDAQ into the runup in 1999 and early 2000.
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
1184
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
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
9900
avatar
1184
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