Done.
Hi,
My skills in MQL5 are quite weak compared to MQL4 and I've never been able to truly carry over referencing indicators in MQL5.
In the example below, the high/low channels plot just fine; however, the moving average does not plot, at least not correctly.
I'm attempting to re-write the iMA( function similar to that of MQL4. Of course, in MQL5 the iMA( function is a handle so an equivalent MQL4 iMA( function needs to be rewritten.
I'm asking not just for iMA( or moving averages, but other functions similar to this (e.g. iRSI(, iStochastic(, etc.).
How would these indicator functions be rewritten in MQL5? Can an equivalent be done? I've many indicators in MQL4 that are multi-symbol and would be nice to create equivalent indicator functions that can be used throughout. If the functions themselves cannot be rewritten, how would they be handled when referencing different symbols or timeframes?
Thank you.
Read the help ( iMA ) first.
Remember: in MQL5, the indicator handle WILL BE CREATED ONCE !!! And it does it in OnInit ().
You must correct your mistake - until you correct your mistake, you cannot move on.

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
My skills in MQL5 are quite weak compared to MQL4 and I've never been able to truly carry over referencing indicators in MQL5.
In the example below, the high/low channels plot just fine; however, the moving average does not plot, at least not correctly.
I'm attempting to re-write the iMA( function similar to that of MQL4. Of course, in MQL5 the iMA( function is a handle so an equivalent MQL4 iMA( function needs to be rewritten.
I'm asking not just for iMA( or moving averages, but other functions similar to this (e.g. iRSI(, iStochastic(, etc.).
How would these indicator functions be rewritten in MQL5? Can an equivalent be done? I've many indicators in MQL4 that are multi-symbol and would be nice to create equivalent indicator functions that can be used throughout. If the functions themselves cannot be rewritten, how would they be handled when referencing different symbols or timeframes?
Thank you.