- Developing MQL4 and running it on MT5 would be backwards compatible. Not possible, completely different Paradigm.
- You want forward compatible, almost never possible.
No, in general terms, they are not compatible, although there are a number of articles that present ideas to be able to transform the codes and make them compatible:
https://www.mql5.com/en/articles/2569
https://www.mql5.com/en/articles/2574
https://www.mql5.com/en/articles/2590
https://www.mql5.com/en/articles/2961
https://www.mql5.com/en/articles/3261
https://www.mql5.com/en/articles/3280
https://www.mql5.com/en/articles/3395
https://www.mql5.com/en/articles/3620
https://www.mql5.com/en/articles/3621
Regards.

- 2016.08.15
- Enrico Lambino
- www.mql5.com
Cross-platform EA example.

- votes: 10
- 2017.09.20
- Iurii Tokman
- www.mql5.com
Is MQL5 backward compatible with MQL4?
The programming language is vastly different in some areas, and as such it is not directly compatible. - Jack
Is MQL5 backward compatible with MQL4?
In other words, can I develop my EA in MQL5 and use it under MetaTrader 4?
It's compatible by means of 3-rd party libraries (includes), which should be #included into your EA source code.
You may find such solutions in the source code base, blogs, and articles. For example: Ready-made Expert Advisors from the MQL5 Wizard work in MetaTrader 4
It's compatible by means of 3-rd party libraries (includes), which should be #included into your EA source code.
You may find such solutions in the source code base, blogs, and articles. For example: Ready-made Expert Advisors from the MQL5 Wizard work in MetaTrader 4
Using a third party library isn't the same thing as the two languages being natively compatible with each other.
The question was "Is MQL5 backward compatible with MQL4". The answer is NO.Using a third party library isn't the same thing as the two languages being natively compatible with each other.
The question was "Is MQL5 backward compatible with MQL4". The answer is NO.
Everyone have a right to have own point of view. No need to post your personal opinion in bold and red.
If you understand the compatibility very strict, someone else (including OP) could accept more flexible meaning of compatibility. Then the answer is something other than NO. If you can add a single include line and your original source code continue running "as is" on other platform this is very very similar to compatibility.
Many features of MQL4 and MQL5 are common!
Everyone have a right to have own point of view. No need to post your personal opinion in bold and red.
If you understand the compatibility very strict, someone else (including OP) could accept more flexible meaning of compatibility. Then the answer is something other than NO. If you can add a single include line and your original source code continue running "as is" on other platform this is very very similar to compatibility.
Many features of MQL4 and MQL5 are common!
I understand the compatibility probably better than most. I've been a programmer for well over 30+ years.
However the question was "Is MQL5 backward compatible with MQL4?".
The answer is NO it is absolutely not backward compatible.
Again... Using a THIRD PARTY LIBRARY is NOT the same thing as the two languages being compatible.
Also you stated:
Many features of MQL4 and MQL5 are common!
That is irrelevant and shows that you don't understand what BACKWARDS COMPATIBILITY means.
C++, Perl, and PHP have many features that are common with MQL4 and MQL5 as well.
They can import third party libraries, they can all manage mysql databases, and they can all produce the onscreen display of information.
However, simply having features that are common or similar, does NOT make them any more compatible to each other simply because of their abilities.
NO. MQL5 is NOT backwards compatible with MQL4.
- Jack
Is MQL5 backward compatible with MQL4?
NO. They are not backward compatible.
Pierre Rougier: In other words, can I develop my EA in MQL5 and use it under MetaTrader 4?
They are two different programming languages and are not directly compatible with each other.
- Jack
I understand the compatibility probably better than most. I've been a programmer for well over 40+ (forty) years.
So I'm right, and you're wrong!
-Fxsaber
PS Dont be upset. Renat (CEO Metaquotes) understands programming worse than you.
FXsaber you are wrong.
Please do not give false information to people.
Here is absolute proof MQL4 is NOT compatible with MQL5.
DEMO MQL4 EA SOURCE CODE
#property copyright "Not applicable" #property link "https://www.mql5.com" #property version "1.00" #property strict int OnInit(){ //This code will execute once when the EA is loaded. for(int x=0; x<10; x++){ Print("The high value of bar "+(string)x+" is "+DoubleToString(iHigh(Symbol(),PERIOD_CURRENT,x),(int)MarketInfo(Symbol(),MODE_DIGITS))); } return(INIT_SUCCEEDED); } void OnDeinit(const int reason){} void OnTick(){}
Copy and paste the above source code into the Metatrader 4 code editor as a new EA.
Just name it MQL4_DEMO.mq4
Click compile and you should see something similar as shown in this screenshot.
You will see that the code compiles without error using the MT4 code editor.
Now open a new chart and add that EA to it.
Now click on the Experts tab to see the output of the bar high information.
It will look something like the image below.
Now then.... Repeat that process with the MT5 code editor.
Name your file MQL5_DEMO
Copy and paste that exact code as provided for the demo above, into the MT5 code editor and click compile.
When you click the compile button you will see that it WILL NOT and CANNOT compile because MQL4 and MQL5 are NOT compatible languages.
Stop given FALSE information to people. MQL4 is NOT compatible with MQL5.
END OF DISCUSSION.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
Is MQL5 backward compatible with MQL4?
In other words, can I develop my EA in MQL5 and use it under MetaTrader 4?
Regards,
Pierre