Download MetaTrader 5

What went wrong here?

To add comments, please log in or register
Do you wonder how to use widgets? Read the article!
chatfinger
13
chatfinger 2013.01.03 16:19 

Hi everyone. Have a nice day.

I am learning MQL5 "translating" some indicators and EAs that were written in MQL4. This time, I am programming the DiNapoli Stochastic, but I find that the MQL5 indicator I programmed, has mistakes respect to MQL4 indicator. If you look so close the MQL5 indicators' outputs, that looks so diferent than original indicator outputs.

In order  to keep certain compatibility with the original MQL4 indicator, I wrote 2 functions that emulates the behavior of iHighest and iLowest functions. They are called myHighest and myLowest; that functions returns the most high or most low values of an interval, delimited by myStart and myCount parameters.

I want to know, what were the mistakes that were made to make the conversion from MQL4 to MQL5, where they are located, and which corrections must be made to ensure that indicator works properly.

I attach for your analysis, a picture of MQL5 indicator, the original MQL4 code, and the modified MQL5 code. 

Best regards,

CHATFINGER

PD: Please forgive any mistake that you find at this post. I don't speak english very well. 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties - Documentation on MQL5
Mosleur Rahaman Riad
337
Mosleur Rahaman Riad 2013.01.06 19:29  
every things going well. 

 

 


puddle
76
puddle 2013.01.07 06:02  
The two indicator buffers must be timeseries.
Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Drawing Styles
Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Drawing Styles
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Drawing Styles - Documentation on MQL5
To add comments, please log in or register