SubscriptionDataConfigExtensions
QuantConnect.Data.SubscriptionDataConfigExtensions
Bases: Object
Helper methods used to determine different configurations properties for a given set of SubscriptionDataConfig
can_be_delisted
can_be_delisted(config: SubscriptionDataConfig) -> bool
True if this configuration is associated with an asset which can have delisting events
data_normalization_mode
data_normalization_mode(
subscription_data_configs: List[SubscriptionDataConfig],
) -> DataNormalizationMode
Extension method used to determine what QuantConnect.DataNormalizationMode to use for a given set of SubscriptionDataConfig
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_data_configs
|
List[SubscriptionDataConfig]
|
|
required |
Returns:
| Type | Description |
|---|---|
DataNormalizationMode
|
The first DataNormalizationMode, DataNormalizationMode.ADJUSTED if there are no subscriptions. |
emit_splits_and_dividends
emit_splits_and_dividends(
config: SubscriptionDataConfig,
) -> bool
Will determine if splits and dividends should be used for this subscription configuration
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
SubscriptionDataConfig
|
The subscription data configuration we are processing |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if this configuration requires split and divided handling. |
get_base_data_instance
get_base_data_instance(
config: SubscriptionDataConfig,
) -> BaseData
Initializes a new instance of the BaseData type defined in config with the symbol properly set
get_highest_resolution
get_highest_resolution(
subscription_data_configs: List[SubscriptionDataConfig],
) -> Resolution
Extension method used to obtain the highest Resolution for a given set of SubscriptionDataConfig
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_data_configs
|
List[SubscriptionDataConfig]
|
|
required |
Returns:
| Type | Description |
|---|---|
Resolution
|
The highest resolution, Resolution.DAILY if there are no subscriptions. |
is_custom_data
is_custom_data(
subscription_data_configs: List[SubscriptionDataConfig],
) -> bool
Extension method used to determine if it is custom data for a given set of SubscriptionDataConfig
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_data_configs
|
List[SubscriptionDataConfig]
|
|
required |
Returns:
| Type | Description |
|---|---|
bool
|
True, at least one subscription is custom data. |
is_extended_market_hours
is_extended_market_hours(
subscription_data_configs: List[SubscriptionDataConfig],
) -> bool
Extension method used to determine if ExtendedMarketHours is enabled for a given set of SubscriptionDataConfig
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_data_configs
|
List[SubscriptionDataConfig]
|
|
required |
Returns:
| Type | Description |
|---|---|
bool
|
True, at least one subscription has it enabled. |
is_fill_forward
is_fill_forward(
subscription_data_configs: List[SubscriptionDataConfig],
) -> bool
Extension method used to determine if FillForward is enabled for a given set of SubscriptionDataConfig
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_data_configs
|
List[SubscriptionDataConfig]
|
|
required |
Returns:
| Type | Description |
|---|---|
bool
|
True, at least one subscription has it enabled. |
prices_should_be_scaled
prices_should_be_scaled(
config: SubscriptionDataConfig, live_mode: bool = False
) -> bool
Will determine if price scaling should be used for this subscription configuration
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
SubscriptionDataConfig
|
The subscription data configuration we are processing |
required |
live_mode
|
bool
|
True, is this is a live mode data stream |
False
|
Returns:
| Type | Description |
|---|---|
bool
|
True if ticker prices should be scaled. |
set_data_normalization_mode
set_data_normalization_mode(
subscription_data_configs: List[SubscriptionDataConfig],
mode: DataNormalizationMode,
) -> None
Sets the data normalization mode to be used by this set of SubscriptionDataConfig
ticker_should_be_mapped
ticker_should_be_mapped(
config: SubscriptionDataConfig,
) -> bool
Will determine if mapping should be used for this subscription configuration
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
SubscriptionDataConfig
|
The subscription data configuration we are processing |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if ticker should be mapped. |