Skip to content

RenkoConsolidator

QuantConnect.Data.Consolidators.RenkoConsolidator

RenkoConsolidator(bar_size: float)

Bases: Generic[QuantConnect_Data_Consolidators_RenkoConsolidator_TInput], QuantConnect_Data_Consolidators_RenkoConsolidator

Provides a type safe wrapper on the RenkoConsolidator class. This just allows us to define our selector functions with the real type they'll be receiving

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

Parameters:

Name Type Description Default
bar_size float

The constant value size of each bar

required

close_on

close_on: datetime

Time of consolidated close.

This codeEntityType is protected.

close_rate

close_rate: float

Value of consolidated close.

This codeEntityType is protected.

high_rate

high_rate: float

Value of consolidated high.

This codeEntityType is protected.

low_rate

low_rate: float

Value of consolidated low.

This codeEntityType is protected.

open_on

open_on: datetime

Time of consolidated open.

This codeEntityType is protected.

open_rate

open_rate: float

Value of consolidate open.

This codeEntityType is protected.

bar_size

bar_size: float

Size of the consolidated bar.

This codeEntityType is protected.

type

type: RenkoType

Gets the kind of the bar

working_data

working_data: IBaseData

Gets a clone of the data being currently consolidated

input_type

input_type: Type

Gets the type consumed by this consolidator

output_type

output_type: Type

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

consolidated

consolidated: IBaseData

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

data_consolidated

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

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

update

update(data: IBaseData) -> None
update(
    data: QuantConnect_Data_Consolidators_RenkoConsolidator_TInput,
) -> None

Signature descriptions:

  • Updates this consolidator with the specified data

  • Updates this consolidator with the specified data.

Parameters:

Name Type Description Default
data IBaseData | QuantConnect_Data_Consolidators_RenkoConsolidator_TInput

The new data for the consolidator

required

dispose

dispose() -> None

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

get_closest_multiple

get_closest_multiple(
    price: float, bar_size: float
) -> float

Gets the closest BarSize-Multiple to the price.

Parameters:

Name Type Description Default
price float

Price to be rounded to the closest BarSize-Multiple

required
bar_size float

The size of the Renko bar

required

Returns:

Type Description
float

The closest BarSize-Multiple to the price.

on_data_consolidated

on_data_consolidated(consolidated: RenkoBar) -> 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 RenkoBar

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