HMA values corrupted

 

I am using a call to an HMA indicator in an EA with the following statement:

HMA1= iCustom(NULL,TimeFrame,"HMA",100,3,0,1,0);

During the backtest I noticed a problem. Printing the values after every 5 minute bar shows large values for HMA. This is a sample result of the printout:

2010.03.07 14:10:02 2010.03.01 08:30 EURUSD,M5: HMA1=1.3604 HMA2=1.3609 EMA1=1.3611 SMA6=1.3611
2010.03.07 14:10:02 2010.03.01 08:26 EURUSD,M5: HMA1= 1.3604 HMA2=1.3609 EMA1=1.3611 SMA6=1.3611
2010.03.07 14:10:02 2010.03.01 08:20 EURUSD,M5: HMA1=2147483647 HMA2=1.3609 EMA1=1.3611 SMA6=1.3611
2010.03.07 14:10:02 2010.03.01 08:15 EURUSD,M5: HMA1=2147483647 HMA2=1.3609 EMA1=1.3611 SMA6=1.3611
2010.03.07 14:10:02 2010.03.01 08:10 EURUSD,M5: HMA1=1.3604 HMA2=1.361 EMA1=1.3611 SMA6=1.3611


Any idea what could be the cause of the corrupted HMA1 values???

 

Hi SquareRoot,

the large values / 2147483647 are number representation of EMPTY_VALUE .

HMA formulas is similar in many versions, but coded differently. Will have to see the entire indicator code to see

for sure. What HMA do you use?


My guess is : your HMA uses at least two buffers to show Up-slope coloring and Down-slope coloring. when slope is

turning direction the other slope buffer returns to the default value of EMPTY_VALUE. You need to call the other buffer too.


regards

Reason: