Consolidator Types

Combining Consolidators

Introduction

Sequential consolidators wire two internal consolidators together such that the output of the first consolidator is the input to the second consolidator and the output of the second consolidator is the output of the sequential consolidator.

Create Consolidators

To create a sequential consolidator, create two consolidators and then pass them to the SequentialConsolidator constructor.

# This first consolidator produces a consolidated bar after a day passes
one_day_consolidator = TradeBarConsolidator(timedelta(days=1))

# This second consolidators produces a consolidated bar after it sees 3 samples
three_count_consolidator = TradeBarConsolidator(3)

# This sequential consolidator aggregates three 1-day bars together
self.consolidator = SequentialConsolidator(one_day_consolidator, three_count_consolidator)
// This first consolidator produces a consolidated bar after a day passes
var oneDayConsolidator = new TradeBarConsolidator(TimeSpan.FromDays(1));

// This second consolidators produces a consolidated bar after it sees 3 samples
var threeCountConsolidator = new TradeBarConsolidator(3);

// This sequential consolidator aggregates three 1-day bars together
_consolidator = new SequentialConsolidator(oneDayConsolidator, threeCountConsolidator);

For more information about each type of consolidator, see Consolidator Types.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: