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

Resampler in strategies can misalign indices #84

Open
kirby561 opened this issue Jun 1, 2022 · 0 comments
Open

Resampler in strategies can misalign indices #84

kirby561 opened this issue Jun 1, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@kirby561
Copy link
Owner

kirby561 commented Jun 1, 2022

There's sort of an implicit assumption in the way that triggers work that the "current index" is the same timestamp for both the original dataset and the filtered dataset. If a resampler is run though, it can change the number of samples in the filtered dataset even if it covers the same timespan. This can cause weird effects and potentially crashes when running strategies.

I can think of a few solutions:

  1. A quick solution would just be to enforce equal spacing to run strategies and not allow filters that change the shape of the data within the strategy itself. That would mean the user would need to resample it before running the strategy which is probably preferred anyway.

  2. Another potential solution would be to allow filters that change shape to be run first and treat the end of shape-changing filter section as the original dataset. While this would work, I think this may be confusing and expecting the shape not to change mid-run is probably fine.

3, If the datasets were indexed using timestamps instead of indices, this problem would go away too. this would be fancy and may need to allow interpolation to be specified somewhere too.

@kirby561 kirby561 added the bug Something isn't working label Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant