Skip to content

PrecalculatedSubscriptionData

QuantConnect.Lean.Engine.DataFeeds.PrecalculatedSubscriptionData

PrecalculatedSubscriptionData(
    configuration: SubscriptionDataConfig,
    raw_data: BaseData,
    normalized_data: BaseData,
    normalization_mode: DataNormalizationMode,
    emit_time_utc: Union[datetime, date],
)

Bases: SubscriptionData

Store data both raw and adjusted and the time at which it should be synchronized

Initializes a new instance of the PrecalculatedSubscriptionData class

Parameters:

Name Type Description Default
configuration SubscriptionDataConfig

The subscription's configuration

required
raw_data BaseData

The base data

required
normalized_data BaseData

The normalized calculated based on raw data

required
normalization_mode DataNormalizationMode

Specifies how data is normalized

required
emit_time_utc Union[datetime, date]

The emit time for the data

required

data

data: BaseData

Gets the data

emit_time_utc

emit_time_utc: datetime

Gets the UTC emit time for this data

create

create(
    daily_strict_end_time_enabled: bool,
    configuration: SubscriptionDataConfig,
    exchange_hours: SecurityExchangeHours,
    offset_provider: TimeZoneOffsetProvider,
    data: BaseData,
    normalization_mode: DataNormalizationMode,
    factor: Optional[float] = None,
) -> SubscriptionData

Clones the data, computes the utc emit time and performs exchange round down behavior, storing the result in a new SubscriptionData instance

Parameters:

Name Type Description Default
configuration SubscriptionDataConfig

The subscription's configuration

required
exchange_hours SecurityExchangeHours

The exchange hours of the security

required
offset_provider TimeZoneOffsetProvider

The subscription's offset provider

required
data BaseData

The data being emitted

required
normalization_mode DataNormalizationMode

Specifies how data is normalized

required
factor Optional[float]

price scale factor

None

Returns:

Type Description
SubscriptionData

A new SubscriptionData containing the specified data.