Lean  $LEAN_TAG$
QuantConnect.Data.Consolidators.TradeBarConsolidator Class Reference

A data consolidator that can make bigger bars from smaller ones over a given time span or a count of pieces of data. More...

Inheritance diagram for QuantConnect.Data.Consolidators.TradeBarConsolidator:
[legend]

Public Member Functions

 TradeBarConsolidator (TimeSpan period)
 Creates a consolidator to produce a new 'TradeBar' representing the period More...
 
 TradeBarConsolidator (int maxCount)
 Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data More...
 
 TradeBarConsolidator (int maxCount, TimeSpan period)
 Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first More...
 
 TradeBarConsolidator (Func< DateTime, CalendarInfo > func)
 Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first More...
 
 TradeBarConsolidator (PyObject pyfuncobj)
 Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first More...
 

Static Public Member Functions

static TradeBarConsolidator FromResolution (Resolution resolution)
 Create a new TradeBarConsolidator for the desired resolution More...
 

Protected Member Functions

override void AggregateBar (ref TradeBar workingBar, TradeBar data)
 Aggregates the new 'data' into the 'workingBar'. The 'workingBar' will be null following the event firing More...
 
- Protected Member Functions inherited from QuantConnect.Data.Consolidators.TradeBarConsolidatorBase< TradeBar >
 TradeBarConsolidatorBase (TimeSpan period)
 Creates a consolidator to produce a new 'TradeBar' representing the period More...
 
 TradeBarConsolidatorBase (int maxCount)
 Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data More...
 
 TradeBarConsolidatorBase (int maxCount, TimeSpan period)
 Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first More...
 
 TradeBarConsolidatorBase (Func< DateTime, CalendarInfo > func)
 Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first More...
 
 TradeBarConsolidatorBase (PyObject pyfuncobj)
 Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first More...
 

Additional Inherited Members

- Public Attributes inherited from QuantConnect.Data.Consolidators.TradeBarConsolidatorBase< TradeBar >
TradeBar WorkingBar
 Gets a copy of the current 'workingBar'. More...
 

Detailed Description

A data consolidator that can make bigger bars from smaller ones over a given time span or a count of pieces of data.

Use this consolidator to turn data of a lower resolution into data of a higher resolution, for example, if you subscribe to minute data but want to have a 15 minute bar.

Definition at line 30 of file TradeBarConsolidator.cs.

Constructor & Destructor Documentation

◆ TradeBarConsolidator() [1/5]

QuantConnect.Data.Consolidators.TradeBarConsolidator.TradeBarConsolidator ( TimeSpan  period)

Creates a consolidator to produce a new 'TradeBar' representing the period

Parameters
periodThe minimum span of time before emitting a consolidated bar

Definition at line 46 of file TradeBarConsolidator.cs.

Here is the caller graph for this function:

◆ TradeBarConsolidator() [2/5]

QuantConnect.Data.Consolidators.TradeBarConsolidator.TradeBarConsolidator ( int  maxCount)

Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data

Parameters
maxCountThe number of pieces to accept before emitting a consolidated bar

Definition at line 55 of file TradeBarConsolidator.cs.

◆ TradeBarConsolidator() [3/5]

QuantConnect.Data.Consolidators.TradeBarConsolidator.TradeBarConsolidator ( int  maxCount,
TimeSpan  period 
)

Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first

Parameters
maxCountThe number of pieces to accept before emitting a consolidated bar
periodThe minimum span of time before emitting a consolidated bar

Definition at line 65 of file TradeBarConsolidator.cs.

◆ TradeBarConsolidator() [4/5]

QuantConnect.Data.Consolidators.TradeBarConsolidator.TradeBarConsolidator ( Func< DateTime, CalendarInfo func)

Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first

Parameters
funcFunc that defines the start time of a consolidated data

Definition at line 74 of file TradeBarConsolidator.cs.

◆ TradeBarConsolidator() [5/5]

QuantConnect.Data.Consolidators.TradeBarConsolidator.TradeBarConsolidator ( PyObject  pyfuncobj)

Creates a consolidator to produce a new 'TradeBar' representing the last count pieces of data or the period, whichever comes first

Parameters
pyfuncobjPython function object that defines the start time of a consolidated data

Definition at line 83 of file TradeBarConsolidator.cs.

Member Function Documentation

◆ FromResolution()

static TradeBarConsolidator QuantConnect.Data.Consolidators.TradeBarConsolidator.FromResolution ( Resolution  resolution)
static

Create a new TradeBarConsolidator for the desired resolution

Parameters
resolutionThe resolution desired
Returns
A consolidator that produces data on the resolution interval

Definition at line 37 of file TradeBarConsolidator.cs.

Here is the call graph for this function:

◆ AggregateBar()

override void QuantConnect.Data.Consolidators.TradeBarConsolidator.AggregateBar ( ref TradeBar  workingBar,
TradeBar  data 
)
protected

Aggregates the new 'data' into the 'workingBar'. The 'workingBar' will be null following the event firing

Parameters
workingBarThe bar we're building, null if the event was just fired and we're starting a new trade bar
dataThe new data

Definition at line 94 of file TradeBarConsolidator.cs.


The documentation for this class was generated from the following file: