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

Allow Consolidator Reset #8320

Open
4 tasks done
AlexCatarino opened this issue Sep 11, 2024 · 0 comments
Open
4 tasks done

Allow Consolidator Reset #8320

AlexCatarino opened this issue Sep 11, 2024 · 0 comments
Assignees

Comments

@AlexCatarino
Copy link
Member

Expected Behavior

It is possible to reset consolidators.
Say we have a weekly or monthly consolidator, and a split occurs. The weekly/monthly bar will have pre- and post-split data:

Captura de ecrã 2024-09-11 231322

We can workaround this issue by removing the consolidator from the subscription_manager, and create a new one.

    def reset_consolidator(self, symbol):
        self.subscription_manager.remove_consolidator(symbol, self.consolidator)
        self.consolidator: TradeBarConsolidator = self.consolidate(symbol, Calendar.WEEKLY, self.on_weekly_bar)

Ideally, this should be a simple reset method call as supported by indicators.

Actual Behavior

We cannot reset indicators.

Potential Solution

Add Reset method that sets the internal working data to null.

Reproducing the Problem

backtest #c52d5e

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
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

3 participants