FrontierAwareEnumerator
QuantConnect.Lean.Engine.DataFeeds.Enumerators.FrontierAwareEnumerator
FrontierAwareEnumerator(
enumerator: IEnumerator[BaseData],
time_provider: ITimeProvider,
offset_provider: TimeZoneOffsetProvider,
)
Bases: Object, IEnumerator[BaseData]
Provides an implementation of IEnumerator{BaseData} that will not emit data ahead of the frontier as specified by an instance of ITimeProvider. An instance of TimeZoneOffsetProvider is used to convert between UTC and the data's native time zone
Initializes a new instance of the FrontierAwareEnumerator class
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enumerator
|
IEnumerator[BaseData]
|
The underlying enumerator to make frontier aware |
required |
time_provider
|
ITimeProvider
|
The time provider used for resolving the current frontier time |
required |
offset_provider
|
TimeZoneOffsetProvider
|
An offset provider used for converting the frontier UTC time into the data's native time zone |
required |
current
current: BaseData
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.