Download MetaTrader 5

Indicators: KAMA

To add comments, please log in or register
One billion tasks have already been executed with MQL5 Cloud Network. Test trading robots even faster!
MetaQuotes Software Corp.
Moderator
181280
MetaQuotes Software Corp. 2009.08.30 08:16 

KAMA:

Kaufman’s Adaptive Moving Average

Author: Walter

MQL4 Comments
16319
MQL4 Comments 2009.09.06 17:43  

I think you got something wrong here...
Coefficients used for calculation of filters should always sum up to 1.
When you calculate the output of this filter you use:

KAMA[i] = KAMA[i+1] + sc * (Close[i] - KAMA[i+1]);

...it should be instead:

KAMA[i] = (1-sc) * KAMA[i+1] + sc * (Close[i] - KAMA[i+1]);



Cheers,
Zyp ;)

whroeder1
14519
whroeder1 2010.01.21 18:12  

KAMA[i] = KAMA[i+1] + sc * (Close[i] - KAMA[i+1]);

...it should be instead:

KAMA[i] = (1-sc) * KAMA[i+1] + sc * (Close[i] - KAMA[i+1]);

Wrong. The formula is

KAMA[i] = (1-sc) * KAMA[i+1] + sc * Close[i]

but that has significant problems with floating point round off. The first equation is equivalent but without the problems.

Иван Корнилов
544
Иван Корнилов 2012.04.11 13:18  
Thanks!
To add comments, please log in or register