How do you convert MT4 indicator to MT5?

doyathink

Active Trader
Mar 8, 2013
5
0
32
You place them in /MQL5/Include/.

At the very least, you need to rename the file from .mq4 to .mq5 and include the libraries there using the #include directive. After you try compiling the new indicator there might be a list of errors to fix.

What do you mean? MetaEditor is just a code editing software and a compiler.
Thanks... that clarifies things for me! I'll work on it soon.... Ignore the platform/editor question... Cheers!
 

Moneyman31

Newbie
Aug 4, 2020
2
0
2
50
Hi all!

I just moved from mt4 to mt5.
However, I am facing a challenge in that I cannot find some of the most useful indicators I was using on mt4.

If anyone can help me in knowing how to convert them or just convert them for free, I'd really appreciate!

These are wonderful indis, especially the sr zones and buyers sellers zones.

Thank you wonderful people.

Jay

Hello, I have the same situation. Did you find the solutions? please share coz I need to convert my mt4 indicator as well.

There is no fully automatic tool, but it is possible to convert indicators from MT4 to MT5 using special libraries I've shared in this post. It doesn't require in-depth knowledge of MQL4/5 coding.

Can u share the link please. Thanks in Advance
 

kizerage212

Newbie
Sep 16, 2020
6
0
2
38
Yeah, there are several files posted here to help with the conversions. I hope Admin Enivid sees this post.
There is ProfitMeter.mqh, KimIVToMT5.mqh, ind4to5.mqh, and a zip file called MT4Orders. Inside the zip file are three folders, Experts, Include, and Scripts.

Inside the Experts folder are three files. orderstostring.mqh, ilan1_4_strict.mq4, and mt4orders_exampleexpert.mq5. I opened the mq4 and mq5 files in metaeditor and there is something wrong. There is a lot of nonsense in there like this, for example, "Âûáåðèòå èíòåðåñóåìûé MT5-ñîâåòíèê" Also, I have no idea where to put these mq4 and mq5 files (experts folder??). But I assume all .mqh files go in the include folder only and not experts folder.

Now the scripts folder has two files mt4orders_examplescript.mq5, and report_strict.mq4. Best guess is they go in the scripts folder. But again, a lot of nonsense when viewed in metaeditor like this for example, ÒÎËÜÊÎ äëÿ äàííîãî ïðèìåðà.

Finally, the include folder has two files mql4_to_mql5.mqh and MT4orders.mqh. I assume they go in the include folder with all the other mqh files mentioned above. There is one problem though. The MT4orders.mqh is in Russian for a lot of it. Is there an english version of this?

Once all that is organized then I need to know how to actually use these files. change my indicator from .mq4 to .mq5. But how to you call these include files in the coding??? What is the coding or wording and where in the coding would you do this? Give examples on how to call all these files at once or how to do it? And that is for the mqh (include files). How do you use the mq4 and mq5 files that were downloaded? For people who don't know coding these things need to be explained in detail if you expect us to try and use these files.

Thanks,
 

Enivid

Administrator
Staff member
Nov 30, 2008
16,000
805
144
Odessa
www.earnforex.com
@kizerage212 .mqh files that are attached in that post as separate files (KimIVToMT5.mqh, ProfitMeter.mqh, and ind4to5.mqh) should go into /MQL5/Include/. The contents of the archive (MT4Orders.zip) should go to /MQL5/ (Experts to Experts, Scripts to Scripts, Include to Include).

Non-latin characters inside the files are most likely commentaries written in Russian. You can simply ignore them.

See my answer to @doyathink regarding using the files.

Using the files doesn't require in-depth knowledge of MQL4/5 coding but it does require knowing some coding basics. Even in good cases, there will be errors that would need to be corrected when using such conversion method.
 

kizerage212

Newbie
Sep 16, 2020
6
0
2
38
@kizerage212 .mqh files that are attached in that post as separate files (KimIVToMT5.mqh, ProfitMeter.mqh, and ind4to5.mqh) should go into /MQL5/Include/. The contents of the archive (MT4Orders.zip) should go to /MQL5/ (Experts to Experts, Scripts to Scripts, Include to Include).

Non-latin characters inside the files are most likely commentaries written in Russian. You can simply ignore them.

See my answer to @doyathink regarding using the files.

Using the files doesn't require in-depth knowledge of MQL4/5 coding but it does require knowing some coding basics. Even in good cases, there will be errors that would need to be corrected when using such conversion method.
Yeah, I included those files using the #include setting and ended up with over 100 errors. The majority of the errors are things like this "
'iMA' - no one of the overloads can be applied to the function call and
could be one of 2 function(s) with
built-in: int iMA(const string,ENUM_TIMEFRAMES,int,int,ENUM_MA_METHOD,int) or
double iMA(string,ENUM_TIMEFRAMES,int,int,ENUM_MA_METHOD,ENUM_APPLIED_PRICE,int) " So you need to know some code understanding of how things are working. And you actual line of code it is flagging on in this example is " hiprice[0] = iMA(NULL,0,1,0,0,Price,shift);" Is there some reference to help figure out how to fix these?
 

Enivid

Administrator
Staff member
Nov 30, 2008
16,000
805
144
Odessa
www.earnforex.com
Yeah, I included those files using the #include setting and ended up with over 100 errors. The majority of the errors are things like this "
'iMA' - no one of the overloads can be applied to the function call and
could be one of 2 function(s) with
built-in: int iMA(const string,ENUM_TIMEFRAMES,int,int,ENUM_MA_METHOD,int) or
double iMA(string,ENUM_TIMEFRAMES,int,int,ENUM_MA_METHOD,ENUM_APPLIED_PRICE,int) " So you need to know some code understanding of how things are working. And you actual line of code it is flagging on in this example is " hiprice[0] = iMA(NULL,0,1,0,0,Price,shift);" Is there some reference to help figure out how to fix these?
Calling indicator values is fundamentally different in MQL5 from MQL4. You can refer to these two articles for basics of how to convert those parts of code:
https://www.mql5.com/en/articles/81 (paragraph "17. Technical Indicators")
https://www.mql5.com/en/articles/31
 

kizerage212

Newbie
Sep 16, 2020
6
0
2
38
Okay, I tried looking at the information for technical indicators. I got one of them to stop showing an error. But still 100 errors. 100 errors seems like too much if you are using those include files (which is suppose to fix most of it, right?). Yeah, those include files don't even work because I just did a test where I did not use any include files and simply just renamed the file from mq4 to mq5 and tried to compile that, It showed 100 errors. So those include files simply are of no use. You might as well convert the thing manually and not even use the include files. But anyway, I've joined this site https://fxdreema.com/converter because they have a converter. Although people say it doesn't work all that great and you usually get errors. So I tried anyway and got only about 7 errors. So again, those include files don't work in the slightest. I managed to fix all 7 errors but there are still 8 warnings (not sure if those matter). The indicator compiles now in mt5 BUT when I load it on the chart it says it is loaded but nothing paints on the chart, it remains blank. So now I'm back to square one. And all I want to do is use Mt5 with my EA (which I already have for Mt5) to run backtests on mt4 indicators because mt4 strategy tester is so slow and unreliable. I didn't realize I had to go down a rabbit hole for one single indicator. Not that you have the time but I went a head and attached the error free mq5 file that doesn't show on the chart in mql5 and also the original source mt4 file that it was converted from. Maybe I'm only missing something simple perhaps.
 

Attachments

bpinon

Newbie
Nov 15, 2020
2
0
1
35
Can someone please help me convert this MT4 indicator to MT5? I know it's easy to find QQE for mt5 but I haven't been able to find a histo version that allows you to change the MA type like this one does. It would be much appreciated!!!
 

Attachments