I am trying to use a custom indicator HMA to smooth the line of another indicator. I have found a couple of different implementations of HMA in Codebase: one is based on SmoothAlgorithms.mqh
(the code is at https://www.mql5.com/en/code/549), and the other uses a function iLWMA (on buffer), which is in the same file as the hma indicator (https://www.mql5.com/en/code/135). Both HMA's work on the chart. However, if I use the HMA based on SmoothAlgorithms.mqh to smooth , for example, RSI, it works.
The other hma based on iLWMA still outputs an HTML line instead of a smoothed RSI line.
I would appreciate it if someone, who is more experienced with mql5 could take a look at the code of those indicators using the links I provided and would explain why the hma based on the iLWMA on buffer function fails to smooth another indicator provided as the last argument to iCustom.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I am trying to use a custom indicator HMA to smooth the line of another indicator. I have found a couple of different implementations of HMA in Codebase: one is based on SmoothAlgorithms.mqh
(the code is at https://www.mql5.com/en/code/549), and the other uses a function iLWMA (on buffer), which is in the same file as the hma indicator (https://www.mql5.com/en/code/135). Both HMA's work on the chart. However, if I use the HMA based on SmoothAlgorithms.mqh to smooth , for example, RSI, it works.
Here is the code I use to create the handles:
RSIHandle=iCustom(_Symbol,PERIOD_CURRENT,"RSI",RSI_Period);
HmaHandle = iCustom(NULL, 0, "hma", MA_Period, RSIHandle);
The other hma based on iLWMA still outputs an HTML line instead of a smoothed RSI line.
I would appreciate it if someone, who is more experienced with mql5 could take a look at the code of those indicators using the links I provided and would explain why the hma based on the iLWMA on buffer function fails to smooth another indicator provided as the last argument to iCustom.