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 ;)
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.
Thanks!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
KAMA:
Author: Walter