Download MetaTrader 5

Applying one indicator to another

To add comments, please log in or register
Dave Hughes
Dave Hughes  

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, and the other uses a function iLWMA (on buffer), which is in the same file as the hma indicator ( 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: 


 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.

Hull Moving Average (HMA)
Hull Moving Average (HMA)
  • votes: 21
  • 2011.11.09
  • Nikolay Kositsin
Hull Moving Average (HMA) that can change its color.
To add comments, please log in or register