Lean
$LEAN_TAG$
|
Consolidator for open markets bar only, extended hours bar are not consolidated. More...
Public Member Functions | |
MarketHourAwareConsolidator (bool dailyStrictEndTimeEnabled, Resolution resolution, Type dataType, TickType tickType, bool extendedMarketHours) | |
Initializes a new instance of the MarketHourAwareConsolidator class. More... | |
virtual void | Update (IBaseData data) |
Updates this consolidator with the specified data More... | |
void | Scan (DateTime currentLocalTime) |
Scans this consolidator to see if it should emit a bar due to time passing More... | |
void | Dispose () |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More... | |
Public Attributes | |
IBaseData | Consolidated => Consolidator.Consolidated |
Gets the most recently consolidated piece of data. This will be null if this consolidator has not produced any data yet. More... | |
Type | InputType => Consolidator.InputType |
Gets the type consumed by this consolidator More... | |
IBaseData | WorkingData => Consolidator.WorkingData |
Gets a clone of the data being currently consolidated More... | |
Type | OutputType => Consolidator.OutputType |
Gets the type produced by this consolidator More... | |
Protected Member Functions | |
void | Initialize (IBaseData data) |
Perform late initialization based on the datas symbol More... | |
virtual CalendarInfo | DailyStrictEndTime (DateTime dateTime) |
Determines a bar start time and period More... | |
virtual bool | UseStrictEndTime (Symbol symbol) |
Useful for testing More... | |
virtual void | ForwardConsolidatedBar (object sender, IBaseData consolidated) |
Will forward the underlying consolidated bar to consumers on this object More... | |
Properties | |
TimeSpan | Period [get] |
The consolidation period requested More... | |
IDataConsolidator | Consolidator [get] |
The consolidator instance More... | |
SecurityExchangeHours | ExchangeHours [get, set] |
The associated security exchange hours instance More... | |
DateTimeZone | DataTimeZone [get, set] |
The associated data time zone More... | |
![]() | |
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 | |
DataConsolidatedHandler | DataConsolidated |
Event handler that fires when a new piece of data is produced More... | |
![]() | |
DataConsolidatedHandler | DataConsolidated |
Event handler that fires when a new piece of data is produced More... | |
Consolidator for open markets bar only, extended hours bar are not consolidated.
Definition at line 28 of file MarketHourAwareConsolidator.cs.
QuantConnect.Data.Common.MarketHourAwareConsolidator.MarketHourAwareConsolidator | ( | bool | dailyStrictEndTimeEnabled, |
Resolution | resolution, | ||
Type | dataType, | ||
TickType | tickType, | ||
bool | extendedMarketHours | ||
) |
Initializes a new instance of the MarketHourAwareConsolidator class.
resolution | The resolution. |
dataType | The target data type |
tickType | The target tick type |
extendedMarketHours | True if extended market hours should be consolidated |
Definition at line 82 of file MarketHourAwareConsolidator.cs.
|
virtual |
Updates this consolidator with the specified data
data | The new data for the consolidator |
Implements QuantConnect.Data.Consolidators.IDataConsolidator.
Definition at line 131 of file MarketHourAwareConsolidator.cs.
void QuantConnect.Data.Common.MarketHourAwareConsolidator.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 P:QuantConnect.Data.BaseData.Time) |
Implements QuantConnect.Data.Consolidators.IDataConsolidator.
Definition at line 145 of file MarketHourAwareConsolidator.cs.
void QuantConnect.Data.Common.MarketHourAwareConsolidator.Dispose | ( | ) |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Definition at line 153 of file MarketHourAwareConsolidator.cs.
|
protected |
Perform late initialization based on the datas symbol
Definition at line 162 of file MarketHourAwareConsolidator.cs.
|
protectedvirtual |
Determines a bar start time and period
Definition at line 178 of file MarketHourAwareConsolidator.cs.
|
protectedvirtual |
Useful for testing
Definition at line 190 of file MarketHourAwareConsolidator.cs.
|
protectedvirtual |
Will forward the underlying consolidated bar to consumers on this object
Definition at line 198 of file MarketHourAwareConsolidator.cs.
IBaseData QuantConnect.Data.Common.MarketHourAwareConsolidator.Consolidated => Consolidator.Consolidated |
Gets the most recently consolidated piece of data. This will be null if this consolidator has not produced any data yet.
Definition at line 58 of file MarketHourAwareConsolidator.cs.
Type QuantConnect.Data.Common.MarketHourAwareConsolidator.InputType => Consolidator.InputType |
Gets the type consumed by this consolidator
Definition at line 63 of file MarketHourAwareConsolidator.cs.
IBaseData QuantConnect.Data.Common.MarketHourAwareConsolidator.WorkingData => Consolidator.WorkingData |
Gets a clone of the data being currently consolidated
Definition at line 68 of file MarketHourAwareConsolidator.cs.
Type QuantConnect.Data.Common.MarketHourAwareConsolidator.OutputType => Consolidator.OutputType |
Gets the type produced by this consolidator
Definition at line 73 of file MarketHourAwareConsolidator.cs.
|
getprotected |
The consolidation period requested
Definition at line 37 of file MarketHourAwareConsolidator.cs.
|
getprotected |
The consolidator instance
Definition at line 42 of file MarketHourAwareConsolidator.cs.
|
getsetprotected |
The associated security exchange hours instance
Definition at line 47 of file MarketHourAwareConsolidator.cs.
|
getsetprotected |
The associated data time zone
Definition at line 52 of file MarketHourAwareConsolidator.cs.
DataConsolidatedHandler QuantConnect.Data.Common.MarketHourAwareConsolidator.DataConsolidated |
Event handler that fires when a new piece of data is produced
Definition at line 125 of file MarketHourAwareConsolidator.cs.