We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello everyone, I can't say for sure, but maybe the KAMA method is not working correctly
function kama(data, len1=10, len2=2, len3=30) { for(var i = len1 + 1, ka = module.exports.sma(data, len1), ka = [ka[ka.length - 1]]; i < data.length; i++) { var vola = 0, change = Math.abs(data[i] - data[i - len1]); for(var a = 1; a < len1; a++) vola += Math.abs(data[(i-a)] - data[(i-a)-1]); var sc = (change/vola * (2/(len2+1) - 2/(len3+1) + 2/(len3+1))) ** 2; ka.push(ka[ka.length - 1] + sc * (data[i] - ka[ka.length - 1])); } return ka; }
If you try to console.log change/vol (ER), sometimes a number above 1 jumps in the array, which should not be.
Also in the line var sc = (change/vola * (2/(len2+1) - 2/(len3+1) + 2/(len3+1))) ** 2; incorrect brackets
var sc = (change/vola * (2/(len2+1) - 2/(len3+1) + 2/(len3+1))) ** 2;
The right option kind of has to be: var sc = (change/vola * (2/(len2+1) - 2/(len3+1)) + 2/(len3+1)) ** 2;
var sc = (change/vola * (2/(len2+1) - 2/(len3+1)) + 2/(len3+1)) ** 2;
Please correct me if I'm wrong
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello everyone, I can't say for sure, but maybe the KAMA method is not working correctly
If you try to console.log change/vol (ER), sometimes a number above 1 jumps in the array, which should not be.
Also in the line
var sc = (change/vola * (2/(len2+1) - 2/(len3+1) + 2/(len3+1))) ** 2;
incorrect bracketsThe right option kind of has to be:
var sc = (change/vola * (2/(len2+1) - 2/(len3+1)) + 2/(len3+1)) ** 2;
Please correct me if I'm wrong
The text was updated successfully, but these errors were encountered: