|
Lean
$LEAN_TAG$
|
Represents a timeless consolidator which depends on the given values. This consolidator is meant to consolidate data into bars that do not depend on time, e.g., RangeBar's. More...
Public Member Functions | |
| void | Update (IBaseData data) |
| Updates this consolidator with the specified data More... | |
| virtual void | Dispose () |
| Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More... | |
| virtual void | Reset () |
| Resets the consolidator More... | |
| void | Scan (DateTime currentLocalTime) |
| Scans this consolidator to see if it should emit a bar due to time passing More... | |
Public Attributes | |
| Type | InputType => typeof(IBaseData) |
| Gets the type consumed by this consolidator More... | |
| virtual Type | OutputType => typeof(T) |
| Gets T which is the type emitted in the IDataConsolidator.DataConsolidated event. More... | |
Protected Member Functions | |
| BaseTimelessConsolidator (Func< IBaseData, decimal > selector=null, Func< IBaseData, decimal > volumeSelector=null) | |
| Initializes a new instance of the BaseTimelessConsolidator<T> class. More... | |
| BaseTimelessConsolidator (PyObject valueSelector, PyObject volumeSelector=null) | |
| Initializes a new instance of the BaseTimelessConsolidator<T> class. More... | |
| abstract void | UpdateBar (DateTime time, decimal currentValue, decimal volume) |
| Updates the current RangeBar being created with the given data. Additionally, if it's the case, it consolidates the current RangeBar More... | |
| abstract void | CreateNewBar (IBaseData data, decimal currentValue, decimal volume) |
| Creates a new bar with the given data More... | |
| void | OnDataConsolidated (T consolidated) |
| Event invocator for the DataConsolidated event. This should be invoked by derived classes when they have consolidated a new piece of data. More... | |
Properties | |
| Func< IBaseData, decimal > | Selector [get, set] |
| Extracts the value from a data instance to be formed into a T. More... | |
| Func< IBaseData, decimal > | VolumeSelector [get, set] |
| Extracts the volume from a data instance. The default value is null which does not aggregate volume per bar. More... | |
| DataConsolidatedHandler | DataConsolidatedHandler [get, set] |
| Event handler type for the IDataConsolidator.DataConsolidated event More... | |
| virtual T | CurrentBar [get, set] |
| Bar being created More... | |
| IBaseData | Consolidated [get, protected set] |
| Gets the most recently consolidated piece of data. This will be null if this consolidator has not produced any data yet. More... | |
| abstract IBaseData | WorkingData [get] |
| Gets a clone of the data being currently consolidated More... | |
Properties inherited from QuantConnect.Data.Consolidators.IDataConsolidator | |
| IBaseData | Consolidated [get] |
| Gets the most recently consolidated piece of data. This will be null if this consolidator has not produced any data yet. More... | |
| IBaseData | WorkingData [get] |
| Gets a clone of the data being currently consolidated More... | |
| Type | InputType [get] |
| Gets the type consumed by this consolidator More... | |
| Type | OutputType [get] |
| Gets the type produced by this consolidator More... | |
Events | |
| EventHandler< T > | DataConsolidated |
| Event handler that fires when a new piece of data is produced More... | |
Events inherited from QuantConnect.Data.Consolidators.IDataConsolidator | |
| DataConsolidatedHandler | DataConsolidated |
| Event handler that fires when a new piece of data is produced More... | |
Represents a timeless consolidator which depends on the given values. This consolidator is meant to consolidate data into bars that do not depend on time, e.g., RangeBar's.
| T | : | IBaseData |
Definition at line 26 of file BaseTimelessConsolidator.cs.
|
protected |
Initializes a new instance of the BaseTimelessConsolidator<T> class.
| selector | Extracts the value from a data instance to be formed into a new bar which inherits from IBaseData. The default value is (x => x.Value) the IBaseData.Value property on IBaseData |
| volumeSelector | Extracts the volume from a data instance. The default value is null which does not aggregate volume per bar. |
Definition at line 92 of file BaseTimelessConsolidator.cs.
|
protected |
Initializes a new instance of the BaseTimelessConsolidator<T> class.
| valueSelector | Extracts the value from a data instance to be formed into a new bar which inherits from IBaseData. The default value is (x => x.Value) the IBaseData.Value property on IBaseData |
| volumeSelector | Extracts the volume from a data instance. The default value is null which does not aggregate volume per bar. |
Definition at line 105 of file BaseTimelessConsolidator.cs.
| void QuantConnect.Data.Consolidators.BaseTimelessConsolidator< T >.Update | ( | IBaseData | data | ) |
Updates this consolidator with the specified data
| data | The new data for the consolidator |
Implements QuantConnect.Data.Consolidators.IDataConsolidator.
Definition at line 144 of file BaseTimelessConsolidator.cs.
|
protectedpure virtual |
Updates the current RangeBar being created with the given data. Additionally, if it's the case, it consolidates the current RangeBar
| time | Time of the given data |
| currentValue | Value of the given data |
| volume | Volume of the given data |
Implemented in QuantConnect.Data.Consolidators.ClassicRenkoConsolidator< TInput >, QuantConnect.Data.Consolidators.RangeConsolidator, and QuantConnect.Data.Consolidators.ClassicRangeConsolidator.
|
protectedpure virtual |
Creates a new bar with the given data
| data | The new data for the bar |
| currentValue | The new value for the bar |
| volume | The new volume to the bar |
Implemented in QuantConnect.Data.Consolidators.ClassicRenkoConsolidator< TInput >, and QuantConnect.Data.Consolidators.RangeConsolidator.
|
protected |
Event invocator for the DataConsolidated event. This should be invoked by derived classes when they have consolidated a new piece of data.
| consolidated | The newly consolidated data |
Definition at line 185 of file BaseTimelessConsolidator.cs.
|
virtual |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
<filterpriority>2</filterpriority>
Definition at line 196 of file BaseTimelessConsolidator.cs.
|
virtual |
Resets the consolidator
Implements QuantConnect.Data.Consolidators.IDataConsolidator.
Reimplemented in QuantConnect.Data.Consolidators.ClassicRenkoConsolidator< TInput >, and QuantConnect.Data.Consolidators.RangeConsolidator.
Definition at line 205 of file BaseTimelessConsolidator.cs.
| void QuantConnect.Data.Consolidators.BaseTimelessConsolidator< T >.Scan | ( | DateTime | currentLocalTime | ) |
Scans this consolidator to see if it should emit a bar due to time passing
| currentLocalTime | The current time in the local time zone (same as BaseData.Time) |
Implements QuantConnect.Data.Consolidators.IDataConsolidator.
Definition at line 215 of file BaseTimelessConsolidator.cs.
| Type QuantConnect.Data.Consolidators.BaseTimelessConsolidator< T >.InputType => typeof(IBaseData) |
Gets the type consumed by this consolidator
Definition at line 64 of file BaseTimelessConsolidator.cs.
| virtual Type QuantConnect.Data.Consolidators.BaseTimelessConsolidator< T >.OutputType => typeof(T) |
Gets T which is the type emitted in the IDataConsolidator.DataConsolidated event.
Definition at line 69 of file BaseTimelessConsolidator.cs.
|
getsetprotected |
Extracts the value from a data instance to be formed into a T.
Definition at line 32 of file BaseTimelessConsolidator.cs.
|
getsetprotected |
Extracts the volume from a data instance. The default value is null which does not aggregate volume per bar.
Definition at line 38 of file BaseTimelessConsolidator.cs.
|
getsetprotected |
Event handler type for the IDataConsolidator.DataConsolidated event
Definition at line 43 of file BaseTimelessConsolidator.cs.
|
getsetprotected |
Bar being created
Definition at line 48 of file BaseTimelessConsolidator.cs.
|
getprotected set |
Gets the most recently consolidated piece of data. This will be null if this consolidator has not produced any data yet.
Definition at line 54 of file BaseTimelessConsolidator.cs.
|
get |
Gets a clone of the data being currently consolidated
Definition at line 59 of file BaseTimelessConsolidator.cs.
| EventHandler<T> QuantConnect.Data.Consolidators.BaseTimelessConsolidator< T >.DataConsolidated |
Event handler that fires when a new piece of data is produced
Definition at line 74 of file BaseTimelessConsolidator.cs.