We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We can consolidate Classic Renko with Futures' tick data using SubscriptionManager.AddConsolidator.
SubscriptionManager.AddConsolidator
All ticks are quotes
Review consolidation logic
class ClassicRenkoBarConsolidatorAlgorithm(QCAlgorithm): _consolidators = {} _bucket_size = 100_000.0 def initialize(self) -> None: self.set_start_date(2025, 3, 1) self.set_end_date(2025, 3, 5) self._es = self.add_future("ES", Resolution.Tick) self._es.set_filter(0,180) def on_consolidated(self, sender: object, bar: TradeBar) -> None: self.log(str(bar)) def on_data(self, slice): if self._es.mapped not in self._consolidators: def selector(data): value = data.quantity * data.price return value consolidator = ClassicRenkoConsolidator(self._bucket_size, selector=selector) consolidator.data_consolidated += self.on_consolidated self.subscription_manager.add_consolidator(self._es.mapped, consolidator, TickType.TRADE) self._consolidators[self._es.mapped] = consolidator #ticks = slice.ticks.get(self._es.mapped, []) #for tick in ticks: # self._consolidators[self._es.mapped].update(tick)
data.quantity is always zero when we use
data.quantity
self.subscription_manager.add_consolidator(self._es.mapped, consolidator, TickType.TRADE)
and we get non-zero values when we update it manually.
master
The text was updated successfully, but these errors were encountered:
JosueNina
No branches or pull requests
Expected Behavior
We can consolidate Classic Renko with Futures' tick data using
SubscriptionManager.AddConsolidator
.Actual Behavior
All ticks are quotes
Potential Solution
Review consolidation logic
Reproducing the Problem
data.quantity
is always zero when we useand we get non-zero values when we update it manually.
Checklist
master
branchThe text was updated successfully, but these errors were encountered: