Is there any way to compile MT5 MQL5 code in a linux environment?

 

I want to compile an EA on linunx because I would like to create a platform that automatically compiles EA images with some differences upon request (for instance, programatically locking an EA to a specific account number).

Is it possible to somehow get an EA compiled on a Linux based server? 


Thanks,
Fernando 

 
Fernando Henrique Gielow:

I want to compile an EA on linunx because I would like to create a platform that automatically compiles EA images with some differences upon request (for instance, programatically locking an EA to a specific account number).

Is it possible to somehow get an EA compiled on a Linux based server? 


Thanks,
Fernando 

No. You cannot automate compilation inside the editor. 

There's a number of other viable options you might wanna consider.

 
Nelson Wanyama:

No. You cannot automate compilation inside the editor. 

There's a number of other viable options you might wanna consider.

I do not want to automate compilation from inside the editor, but rather use command-line.

I know this is viable in Windows machines, but I enquire about Linux because I find it prefferable to manage Linux based servers, if that's possible of course. 

Regardless- you mention other viable options, could you point me to them?


Thanks

 

Yes, you can. iirc I did something like that years ago. Basically you can use wine to run the metaeditor from command line and compile the sources, check the command line options for that.

Anyway If you have any skills with bash, you can do a lot of things and of course the locking one you are asking for.

Edit:

Start from here

https://www.metatrader5.com/en/metaeditor/help/beginning/integration_ide

Integration with other IDEs - MetaEditor Help
Integration with other IDEs - MetaEditor Help
  • www.metatrader5.com
MetaEditor allows you to write code not only in MQL4 and MQL5. You can also edit and compile a C++ source code (the number of supported languages ​​is to be increased in the future). In addition, you can use MetaEditor as an external compiler in other development environments. Editing C++ code and DLL compilation When developing trading...
 
Fernando Henrique Gielow:

I do not want to automate compilation from inside the editor, but rather use command-line.

I know this is viable in Windows machines, but I enquire about Linux because I find it prefferable to manage Linux based servers, if that's possible of course. 

Regardless- you mention other viable options, could you point me to them?


Thanks

not sure if you have existing windows vps that you use to test your strategy or others (unless you're all running linux)

- in your linux server, you could setup nfs share that will contain your autogenerated mql source code

- mount that nfs share to your windows server, donwload the mql compiler and place it in the nfs share

- enable ssh server in your windows server

- create bash script to ssh in to window server and run one liner parameterized compile command (or cmd file inside the share that accepts arguments, later invoke the cmd)

- the ex output physically inside your linux server

- best is to have the servers in the same network, public route is possible just but needs security configuration

- you could do the other way around, windows as the nfs..

this is just an alternative if you're not comfortable using wine and want separation of concern
Virtual hosting for MetaTrader 5
Virtual hosting for MetaTrader 5
  • www.mql5.com
Virtual hosting for MetaTrader 4/5 is the best VPS solution for Forex. It is cheap, it requires no configuration and it features minimum delays to the server. For only 15 USD per month, you obtain a virtual platform that works around the clock, saves your profit and pays off. Create a remote copy of the application directly from the...
 
Aleksandar Petrinic:

Yes, you can. iirc I did something like that years ago. Basically you can use wine to run the metaeditor from command line and compile the sources, check the command line options for that.

Anyway If you have any skills with bash, you can do a lot of things and of course the locking one you are asking for.

Edit:

Start from here

https://www.metatrader5.com/en/metaeditor/help/beginning/integration_ide

Hmm was afraid of using Wine for this, but I might as well try it.

Thanks!