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

Fix SMA formula #4

Open
wuhkuh opened this issue Sep 3, 2017 · 0 comments
Open

Fix SMA formula #4

wuhkuh opened this issue Sep 3, 2017 · 0 comments

Comments

@wuhkuh
Copy link
Owner

wuhkuh commented Sep 3, 2017

When calculating the SMA of index 6 with period 5, it includes index 1, as the sum is inclusive.
However, it should only calculate with indexes 2, 3, 4, 5 and 6.

Solution:
Formula underneath the sum should be k = i - p + 1

@wuhkuh wuhkuh added this to the 0.1.0 milestone Sep 3, 2017
@wuhkuh wuhkuh self-assigned this Sep 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant