ClassicRenkoConsolidator
QuantConnect.Data.Consolidators.ClassicRenkoConsolidator
ClassicRenkoConsolidator(
bar_size: float,
selector: Any,
volume_selector: Any = None,
even_bars: bool = True,
)
ClassicRenkoConsolidator(
bar_size: float, even_bars: bool = True
)
ClassicRenkoConsolidator(
bar_size: float,
selector: Callable[[IBaseData], float],
volume_selector: Callable[[IBaseData], float] = None,
even_bars: bool = True,
)
ClassicRenkoConsolidator(
bar_size: float,
selector: Callable[
[
QuantConnect_Data_Consolidators_ClassicRenkoConsolidator_TInput
],
float,
],
volume_selector: Callable[
[
QuantConnect_Data_Consolidators_ClassicRenkoConsolidator_TInput
],
float,
] = None,
even_bars: bool = True,
)
ClassicRenkoConsolidator(bar_size: float, type: RenkoType)
Bases: Generic[QuantConnect_Data_Consolidators_ClassicRenkoConsolidator_TInput], QuantConnect_Data_Consolidators_ClassicRenkoConsolidator
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
Signature descriptions:
-
Initializes a new instance of the ClassicRenkoConsolidator class.
-
Initializes a new instance of the ClassicRenkoConsolidator class using the specified bar_size. The value selector will by default select IBaseData.value The volume selector will by default select zero.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bar_size
|
float
|
The size of each bar in units of the value produced by selector |
required |
selector
|
Optional[Any | Callable[[IBaseData], float] | Callable[[QuantConnect_Data_Consolidators_ClassicRenkoConsolidator_TInput], float]]
|
Extracts the value from a data instance to be formed into a RenkoBar. The default |
None
|
volume_selector
|
Optional[Any | Callable[[IBaseData], float] | Callable[[QuantConnect_Data_Consolidators_ClassicRenkoConsolidator_TInput], float]]
|
Extracts the volume from a data instance. The default value is null which does |
None
|
even_bars
|
Optional[bool]
|
When true bar open/close will be a multiple of the bar_size |
True
|
type
|
Optional[RenkoType]
|
The RenkoType of the bar |
None
|
output_type
output_type: Type
Gets RenkoBar which is the type emitted in the IDataConsolidator.data_consolidated event.
create_new_bar
create_new_bar(
data: IBaseData, current_value: float, volume: float
) -> None
Creates a new bar with the given data
This codeEntityType is protected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
IBaseData
|
The new data for the bar |
required |
current_value
|
float
|
The new value for the bar |
required |
volume
|
float
|
The new volume to the bar |
required |
reset
reset() -> None
Resets the ClassicRenkoConsolidator
update
update(
data: QuantConnect_Data_Consolidators_ClassicRenkoConsolidator_TInput,
) -> None
Updates this consolidator with the specified data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
QuantConnect_Data_Consolidators_ClassicRenkoConsolidator_TInput
|
The new data for the consolidator |
required |
update_bar
update_bar(
time: Union[datetime, date],
current_value: float,
volume: float,
) -> None
Updates the current RangeBar being created with the given data. Additionally, if it's the case, it consolidates the current RangeBar
This codeEntityType is protected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
Union[datetime, date]
|
Time of the given data |
required |
current_value
|
float
|
Value of the given data |
required |
volume
|
float
|
Volume of the given data |
required |