Skip to content

PriceScaleFactorEnumerator

QuantConnect.Lean.Engine.DataFeeds.Enumerators.PriceScaleFactorEnumerator

PriceScaleFactorEnumerator(
    raw_data_enumerator: IEnumerator[BaseData],
    config: SubscriptionDataConfig,
    factor_file_provider: IFactorFileProvider,
    live_mode: bool = False,
    end_date: Optional[datetime] = None,
)

Bases: Object, IEnumerator[BaseData]

This enumerator will update the SubscriptionDataConfig.price_scale_factor when required and adjust the raw BaseData prices based on the provided SubscriptionDataConfig. Assumes the prices of the provided IEnumerator are in raw mode.

Creates a new instance of the PriceScaleFactorEnumerator.

Parameters:

Name Type Description Default
raw_data_enumerator IEnumerator[BaseData]

The underlying raw data enumerator

required
config SubscriptionDataConfig

The SubscriptionDataConfig to enumerate for. Will determine the DataNormalizationMode to use.

required
factor_file_provider IFactorFileProvider

The IFactorFileProvider instance to use

required
live_mode bool

True, is this is a live mode data stream

False
end_date Optional[datetime]

The enumerator end date

None

current

current: BaseData

Last read BaseData object from this type and source

dispose

dispose() -> None

Dispose of the underlying enumerator.

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

Reset the IEnumeration