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

Add simple RollingWindow trait #17

Open
apriori opened this issue Jan 3, 2020 · 1 comment
Open

Add simple RollingWindow trait #17

apriori opened this issue Jan 3, 2020 · 1 comment

Comments

@apriori
Copy link

apriori commented Jan 3, 2020

Pretty much just

trait RollingWindow {
  fn length(&self) -> usize;
}

for all indicators. This won't hide the fact that all these indicators are essentially rolling window filters and need to be pre-fed with historical data with length (RollingWindow::length -1). For combined indicators this is of course the max rolling window length of all indicators (-1, of course).

I use this information in order to read the pre-feed for the window e.g. via ordinary rest calls and then turn to websockets based listening and async streaming. The first yielded value is then the current (in time) value for the given indicator.

@greyblake
Copy link
Owner

Thanks for your report.
I may name the trait differently I got the idea and thinks your requirement is reasonable so I'll implement it.

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

2 participants