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

SMAIndicator inner cache #1139

Closed
2 tasks done
sgflt opened this issue Mar 28, 2024 · 0 comments · Fixed by #1140
Closed
2 tasks done

SMAIndicator inner cache #1139

sgflt opened this issue Mar 28, 2024 · 0 comments · Fixed by #1140
Labels
enhancement Issue describing or discussing an enhancement for this library

Comments

@sgflt
Copy link
Contributor

sgflt commented Mar 28, 2024

I have checked existing issues and wiki

Is your feature request related to a problem? Please describe.
SMAIndicator may benefit from reusage of precalculated partial sums.
CachedIndicator caches only final result, but, for example, SMA 200 have to iterate over 200 bars for each new bar again and again.
We can store for serial access previous sum and then subtract FIFO bar which gous out and add a new bar which goes in.

@sgflt sgflt added the enhancement Issue describing or discussing an enhancement for this library label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue describing or discussing an enhancement for this library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant