ScannableEnumerator
QuantConnect.Lean.Engine.DataFeeds.Enumerators.ScannableEnumerator
ScannableEnumerator(
consolidator: Union[
IDataConsolidator, PythonConsolidator, timedelta
],
time_zone: Any,
time_provider: ITimeProvider,
new_data_available_handler: Callable[
[Object, EventArgs], Any
],
is_period_based: bool = True,
)
Bases: Generic[QuantConnect_Lean_Engine_DataFeeds_Enumerators_ScannableEnumerator_T], Object, IEnumerator[QuantConnect_Lean_Engine_DataFeeds_Enumerators_ScannableEnumerator_T]
An implementation of IEnumerator{T} that relies on "consolidated" data
Initializes a new instance of the ScannableEnumerator{T} class
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
consolidator
|
Union[IDataConsolidator, PythonConsolidator, timedelta]
|
Consolidator taking BaseData updates and firing events containing new 'consolidated' data |
required |
time_zone
|
Any
|
The time zone the raw data is time stamped in |
required |
time_provider
|
ITimeProvider
|
The time provider instance used to determine when bars are completed and can be emitted |
required |
new_data_available_handler
|
Callable[[Object, EventArgs], Any]
|
The event handler for a new available data point |
required |
is_period_based
|
bool
|
The consolidator is period based, this will enable scanning on move_next |
True
|
current
current: QuantConnect_Lean_Engine_DataFeeds_Enumerators_ScannableEnumerator_T
Gets the element in the collection at the current position of the enumerator.
dispose
dispose() -> None
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
move_next
move_next() -> bool
Advances the enumerator to the next element of the collection.
Returns:
| Type | Description |
|---|---|
bool
|
true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. |
reset
reset() -> None
Sets the enumerator to its initial position, which is before the first element in the collection.
update
update(
data: QuantConnect_Lean_Engine_DataFeeds_Enumerators_ScannableEnumerator_T,
) -> None
Updates the consolidator
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
QuantConnect_Lean_Engine_DataFeeds_Enumerators_ScannableEnumerator_T
|
The data to consolidate |
required |