Skip to content

MarketHourAwareConsolidator

QuantConnect.Data.Common.MarketHourAwareConsolidator

MarketHourAwareConsolidator(
    daily_strict_end_time_enabled: bool,
    resolution: Resolution,
    data_type: Type,
    tick_type: TickType,
    extended_market_hours: bool,
)

Bases: Object, IDataConsolidator

Consolidator for open markets bar only, extended hours bar are not consolidated.

Initializes a new instance of the MarketHourAwareConsolidator class.

Parameters:

Name Type Description Default
resolution Resolution

The resolution.

required
data_type Type

The target data type

required
tick_type TickType

The target tick type

required
extended_market_hours bool

True if extended market hours should be consolidated

required

period

period: timedelta

The consolidation period requested

This codeEntityType is protected.

consolidator

consolidator: IDataConsolidator

The consolidator instance

This codeEntityType is protected.

exchange_hours

exchange_hours: SecurityExchangeHours

The associated security exchange hours instance

This codeEntityType is protected.

data_time_zone

data_time_zone: Any

The associated data time zone

This codeEntityType is protected.

consolidated

consolidated: IBaseData

Gets the most recently consolidated piece of data. This will be null if this consolidator has not produced any data yet.

input_type

input_type: Type

Gets the type consumed by this consolidator

working_data

working_data: IBaseData

Gets a clone of the data being currently consolidated

output_type

output_type: Type

Gets the type produced by this consolidator

data_consolidated

data_consolidated: _EventContainer[
    Callable[[Object, IBaseData], Any], Any
]

Event handler that fires when a new piece of data is produced

daily_strict_end_time

daily_strict_end_time(
    date_time: Union[datetime, date],
) -> CalendarInfo

Determines a bar start time and period

This codeEntityType is protected.

dispose

dispose() -> None

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

forward_consolidated_bar

forward_consolidated_bar(
    sender: Any, consolidated: IBaseData
) -> None

Will forward the underlying consolidated bar to consumers on this object

This codeEntityType is protected.

initialize

initialize(data: IBaseData) -> None

Perform late initialization based on the datas symbol

This codeEntityType is protected.

reset

reset() -> None

Resets the consolidator

scan

scan(current_local_time: Union[datetime, date]) -> None

Scans this consolidator to see if it should emit a bar due to time passing

Parameters:

Name Type Description Default
current_local_time Union[datetime, date]

The current time in the local time zone (same as QuantConnect.Data.BaseData.Time)

required

update

update(data: IBaseData) -> None

Updates this consolidator with the specified data

Parameters:

Name Type Description Default
data IBaseData

The new data for the consolidator

required

use_strict_end_time

use_strict_end_time(
    symbol: Union[Symbol, str, BaseContract],
) -> bool

Useful for testing

This codeEntityType is protected.