Skip to content
New issue

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

ma 计算有问题 #1

Open
jarze opened this issue Feb 28, 2018 · 2 comments
Open

ma 计算有问题 #1

jarze opened this issue Feb 28, 2018 · 2 comments

Comments

@jarze
Copy link

jarze commented Feb 28, 2018

No description provided.

@kaiduo
Copy link

kaiduo commented May 4, 2018

var ma = function(ticks, dayCount) {
var result = [];
for (var i = 0, len = ticks.length; i < len; i++) {
if (i < dayCount) {
result.push('-');
continue;
}
var sum = 0;
for (var j = 0; j < dayCount; j++) {
sum += ticks[i - j];
}
result.push((sum / dayCount).toFixed(2));
}
return result;
};

@wrule
Copy link

wrule commented Dec 28, 2021

基本上,每一个指标计算都是错的,,,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants