Skip to content

VolumeRenkoConsolidator

QuantConnect.Data.Consolidators.VolumeRenkoConsolidator

VolumeRenkoConsolidator(bar_size: float)

Bases: DataConsolidator[BaseData]

This consolidator can transform a stream of BaseData instances into a stream of RenkoBar with a constant volume for each bar.

Initializes a new instance of the VolumeRenkoConsolidator class using the specified bar_size.

Parameters:

Name Type Description Default
bar_size float

The constant volume size of each bar

required

working_data

working_data: IBaseData

Gets a clone of the data being currently consolidated

output_type

output_type: Type

Gets VolumeRenkoBar which is the type emitted in the IDataConsolidator.data_consolidated event.

data_consolidated

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

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

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

adjust_volume

adjust_volume(volume: float, price: float) -> float

Returns the raw volume without any adjustment.

This codeEntityType is protected.

Parameters:

Name Type Description Default
volume float

The volume

required
price float

The price

required

Returns:

Type Description
float

The unmodified volume.

on_data_consolidated

on_data_consolidated(consolidated: VolumeRenkoBar) -> None

Event invocator for the DataConsolidated event. This should be invoked by derived classes when they have consolidated a new piece of data.

This codeEntityType is protected.

Parameters:

Name Type Description Default
consolidated VolumeRenkoBar

The newly consolidated data

required

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 BaseData.time)

required

update

update(data: BaseData) -> None

Updates this consolidator with the specified data

Parameters:

Name Type Description Default
data BaseData

The new data for the consolidator

required

dispose

dispose() -> None

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