Migration from mt4 to mt5 of an indicator

 

I found an old indicator online which I would like to convert in mt5, I tried by myself, however they give me different results and after days of testing I'm not able to find the right solution. I attach the two files. 


Thank you for your help!

Files:
 
ElGuapo: I found an old indicator online which I would like to convert in mt5, I tried by myself, however they give me different results and after days of testing I'm not able to find the right solution. I attach the two files. 

The author of the code is here on this site, namely @Mladen Rakic. Have a look at his many publications in the CodeBase. You may find the MQL5 version already available.

The following link is a search request for CodeBase publications by him, with the keyword "DMI".

The following link is a search request for CodeBase publications by him, with the keyword "Wilder".

 
Fernando Carreiro #:

The author of the code is here on this site, namely @Mladen Rakic. Have a look at his many publications in the CodeBase. You may find the MQL5 version already available.

The following link is a search request for CodeBase publications by him, with the keyword "DMI".

The following link is a search request for CodeBase publications by him, with the keyword "Wilder".

Hi Fernando, thanks for your reply. I already looked at his codebase, however, this indicator is not availablke in mt5 and I would like to code it!

 
ElGuapo #: Hi Fernando, thanks for your reply. I already looked at his codebase, however, this indicator is not availablke in mt5 and I would like to code it!

He does in fact, but just with more features. Just disable the volume weighting and hide ADX and ADXR lines. It may however be visually somewhat differently represented but conveys more information.

Code Base

Volume Weighted Wilder's DMI

Mladen Rakic, 2016.10.31 14:59

This is a volume weighted Wilder's DMI (the real ADX).
 
Fernando Carreiro #:

He does in fact, but just with more features. Just disable the volume weighting and hide ADX and ADXR lines. It may however be visually somewhat differently represented but conveys more information.

Hi Fernando. Sorry to bother you, but in my opinion they are not the same. Even if it says that it is, the mt4 version has an histogram where values are negative or positive (i.e for one candle the indicator has a green or red bar). In this mt5 version the histogram is not present and the values are some sort of areas which is completetly different from the mt4 meaning / visualization. Moreover, if you try to compare these indicators they seem to have completely different meanings. I compared also the values for the same candle and they give me different results

I would like to obtain the same thing as mt4.
 
ElGuapo #: Hi Fernando. Sorry to bother you, but in my opinion they are not the same. Even if it says that it is, the mt4 version has an histogram where values are negative or positive (i.e for one candle the indicator has a green or red bar). In this mt5 version the histogram is not present and the values are some sort of areas which is completetly different from the mt4 meaning / visualization. Moreover, if you try to compare these indicators they seem to have completely different meanings. I compared also the values for the same candle and they give me different resultsI would like to obtain the same thing as mt4.
I disagree with your analysis, but that does not matter. What matters is that the source code is provided, giving you the opportunity to adapt it to however you want it to look like visually with much less effort than to convert the MQL4 version.
 
Fernando Carreiro #:
I disagree with your analysis, but that does not matter. What matters is that the source code is provided, giving you the opportunity to adapt it to however you want it to look like visually with much less effort than to convert the MQL4 version.

Ok, can I ask you your help on my mq5 version? It seems so close to the mt4 one but I'm not able to spot what makes the difference. I tried by myself and I'm not asking you to do it from scratch, but just to help me fixing my code, if you want to help me.


Thanks!

(I put the indicator that you suggest on the same chart in mt5 and the old one in mt4 and they give me very different result, my analysis has a visual proof, maybe I'm missig something)
 
Fernando Carreiro #:
much less effort than to convert the MQL4 version.

Good evening Sir. Sorry to bother you again but I looked at the indicator that you rpovided to me on many different charts, comparing with the mt4 version and the values of the indicator are different. Apart from this, my question was if someone could help me fixing my code mt5 version in order to get the same type of indicator (also visually).

 Thank you for your patience

 
ElGuapo #:

Good evening Sir. Sorry to bother you again but I looked at the indicator that you rpovided to me on many different charts, comparing with the mt4 version and the values of the indicator are different. Apart from this, my question was if someone could help me fixing my code mt5 version in order to get the same type of indicator (also visually).

 Thank you for your patience

Before you decide the use a indicator, do you know the logic behind said indicator, how mathematically the results are calculated?

 
lakelake #:

Before you decide the use a indicator, do you know the logic behind said indicator, how mathematically the results are calculated?

Hello lakelake, thank you for your interest. Yes I understood it by looking at the code. The problem is not related with the meaning of the code itself but rather on the changes from mt4 to mt5 of some functions that probably I don't get. Moreover, I think that the mt4 version is outdated and uses some functionalities that are note present anymore in mt5. My mt5 version is close to the mt4 one, I'm not trying to ask in this forum to do it for me from scratch, just to have some help as in all the community of programmers, if some of you are not intended to help me just say it.

Thank you. 

 
Good evening guys, I tried to adjust the indicator again but without success, is there anybody willing to help me? Thank you so much. 
Reason: