What is your workflow for maintaining single-source code files between MQL5 and MQL4+ projects? - page 2
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
- I am using two different installations, one for MT5, one for MT4.
- I avoid the .mq4 and .mq5 extensions for real code and always create .mqh files which are just included in these .mq4/.mq5. This way I avoid double coding
- I packed all native MQL commands into a separate file, so that the almost all conditions like #ifdef __MQL4__ are located in one single file
- I packed all trade relevant code into a separate file and created a class which allows for trading with MT4/MT5 by providing the same functions
- Coding is done only within MT5 environment
- To synchronize / copy changes to the MT4 instance, I use the FreeFileSync app. After changes within MT5 code, it needs one click to update the whole MT4 folder-strcuture. Within MT4 I just compile, never edit. To update from MT5 to MT4 and to re-compile the complete stuff, which contains far more than 100 files, it takes less than 3 minutes.
The process works reliable and without any issues since years.Thanks!
Welcome :)
Here are a few updates for your information, should it be of interest to anyone:
Here are a few updates for your information, should it be of interest to anyone:
...
Editing and Compiling both MQL4 and MQL5 from a single MetaEditor:
mql4 compilation is no more supported with the new MT5 MetaEditor build (maybe 6 months ago ? I don't remember exactly).
MT5 32 bit support is stopped. So I suppose you can compile ex5 with the MT4 version of MetaEditor but I don't think you will be able to use it, and for sure you will not benefit from the last mql5 features (and bugs loool).