build and maintain EA in both MQL 5 & MQL 4

 

Hi, 

I have an EA in MQL5. couple of my partners want to run in brokers who supports only MT4. so I want to convert that to MQL 4 and also want to maintain both in MQL5 & MQL4 versions. 

is there way to structure the code so that its easy to maintain both MQL4/5 versions. you can suggest just the basic structure / framework. I can do the conversion.  

 
Saravana kumar:

Hi, 

I have an EA in MQL5. couple of my partners want to run in brokers who supports only MT4. so I want to convert that to MQL 4 and also want to maintain both in MQL5 & MQL4 versions. 

is there way to structure the code so that its easy to maintain both MQL4/5 versions. you can suggest just the basic structure / framework. I can do the conversion.  

As a starting point, there are features, that are not available in MQL4, but you can take a look on how I went about making MQL5 code run on MQL4.

Take a look at Public Shared Projects in MetaEditor and look for MQLplus. It contains a folder with mql4 compatibility files.

I managed most of my code to be mql4 compatibile with this.




Reason: