Skip to content

SubscriptionDataConfig

QuantConnect.Data.SubscriptionDataConfig

SubscriptionDataConfig(
    object_type: Type,
    symbol: Union[Symbol, str, BaseContract],
    resolution: Resolution,
    data_time_zone: Any,
    exchange_time_zone: Any,
    fill_forward: bool,
    extended_hours: bool,
    is_internal_feed: bool,
    is_custom: bool = False,
    tick_type: Optional[TickType] = None,
    is_filtered_subscription: bool = True,
    data_normalization_mode: DataNormalizationMode = ...,
    data_mapping_mode: DataMappingMode = ...,
    contract_depth_offset: int = 0,
    mapped_config: bool = False,
)
SubscriptionDataConfig(
    config: SubscriptionDataConfig,
    object_type: Type = None,
    symbol: Union[Symbol, str, BaseContract] = None,
    resolution: Optional[Resolution] = None,
    data_time_zone: Any = None,
    exchange_time_zone: Any = None,
    fill_forward: Optional[bool] = None,
    extended_hours: Optional[bool] = None,
    is_internal_feed: Optional[bool] = None,
    is_custom: Optional[bool] = None,
    tick_type: Optional[TickType] = None,
    is_filtered_subscription: Optional[bool] = None,
    data_normalization_mode: Optional[
        DataNormalizationMode
    ] = None,
    data_mapping_mode: Optional[DataMappingMode] = None,
    contract_depth_offset: Optional[int] = None,
    mapped_config: Optional[bool] = None,
)

Bases: Object, IEquatable[QuantConnect_Data_SubscriptionDataConfig]

Subscription data required including the type of data.

Signature descriptions:

  • Constructor for Data Subscriptions

  • Copy constructor with overrides

Parameters:

Name Type Description Default
object_type Type

Type of the data objects.

None
symbol Union[Symbol, str, BaseContract]

Symbol of the asset we're requesting

None
resolution Resolution | Optional[Resolution]

Resolution of the asset we're requesting

None
data_time_zone Any

The time zone the raw data is time stamped in

None
exchange_time_zone Any

Specifies the time zone of the exchange for the security this subscription is for. This

None
fill_forward bool | Optional[bool]

Fill in gaps with historical data

None
extended_hours bool | Optional[bool]

Equities only - send in data from 4am - 8pm

None
is_internal_feed bool | Optional[bool]

Set to true if this subscription is added for the sole purpose of providing currency conversion rates,

None
is_custom bool | Optional[bool]

True if this is user supplied custom data, false for normal QC data

False
tick_type Optional[TickType]

Specifies if trade or quote data is subscribed

None
is_filtered_subscription bool | Optional[bool]

True if this subscription should have filters applied to it (market hours/user filters from security), false otherwise

True
data_normalization_mode DataNormalizationMode | Optional[DataNormalizationMode]

Specifies normalization mode used for this subscription

...
data_mapping_mode DataMappingMode | Optional[DataMappingMode]

The contract mapping mode to use for the security

...
contract_depth_offset int | Optional[int]

The continuous contract desired offset from the current front month.

0
config Optional[SubscriptionDataConfig]

The config to copy, then overrides are applied and all option

None
mapped_config bool | Optional[bool]

True if this is created as a mapped config. This is useful for continuous contract at live trading

False

new_symbol

new_symbol: _EventContainer[
    Callable[[Object, NewSymbolEventArgs], Any], Any
]

Event fired when there is a new symbol due to mapping

type

type: Type

Type of data

security_type

security_type: SecurityType

Security type of this data subscription

symbol

symbol: Symbol

Symbol of the asset we're requesting: this is really a perm tick!!

tick_type

tick_type: TickType

Trade, quote or open interest data

resolution

resolution: Resolution

Resolution of the asset we're requesting, second minute or tick

increment

increment: timedelta

Timespan increment between triggers of this data:

fill_data_forward

fill_data_forward: bool

True if wish to send old data when time gaps in data feed.

extended_market_hours

extended_market_hours: bool

Boolean Send Data from between 4am - 8am (Equities Setting Only)

is_internal_feed

is_internal_feed: bool

True if this subscription was added for the sole purpose of providing currency conversion rates via CashBook.ensure_currency_data_feeds

is_custom_data

is_custom_data: bool

True if this subscription is for custom user data, false for QC data

sum_of_dividends

sum_of_dividends: float

The sum of dividends accrued in this subscription, used for scaling total return prices

data_normalization_mode

data_normalization_mode: DataNormalizationMode

Gets the normalization mode used for this subscription

data_mapping_mode

data_mapping_mode: DataMappingMode

Gets the securities mapping mode used for this subscription

contract_depth_offset

contract_depth_offset: int

The continuous contract desired offset from the current front month. For example, 0 (default) will use the front month, 1 will use the back month contract

price_scale_factor

price_scale_factor: float

Price Scaling Factor:

mapped_symbol

mapped_symbol: str

Symbol Mapping: When symbols change over time (e.g. CHASE-> JPM) need to update the symbol requested.

market

market: str

Gets the market / scope of the symbol

data_time_zone

data_time_zone: Any

Gets the data time zone for this subscription

exchange_time_zone

exchange_time_zone: Any

Gets the exchange time zone for this subscription

consolidators

consolidators: ISet[IDataConsolidator]

Consolidators that are registred with this subscription

is_filtered_subscription

is_filtered_subscription: bool

Gets whether or not this subscription should have filters applied to it (market hours/user filters from security)

NewSymbolEventArgs

NewSymbolEventArgs(
    new: Union[Symbol, str, BaseContract],
    old: Union[Symbol, str, BaseContract],
)

Bases: EventArgs

New base class for all event classes.

Create an instance of NewSymbolEventArgs

Parameters:

Name Type Description Default
new Union[Symbol, str, BaseContract]
required
old Union[Symbol, str, BaseContract]
required

old

old: Symbol

The old symbol instance

new

new: Symbol

The new symbol instance

equals

equals(obj: Any) -> bool
equals(other: SubscriptionDataConfig) -> bool

Signature descriptions:

  • Determines whether the specified object is equal to the current object.

  • Indicates whether the current object is equal to another object of the same type.

Parameters:

Name Type Description Default
obj Optional[Any]

The object to compare with the current object.

None
other Optional[SubscriptionDataConfig]

An object to compare with this object.

None

Returns:

Type Description
bool

Depends on the signature used. Case 1: [true if the specified object is equal to the current object; otherwise, false.]; Case 2: [true if the current object is equal to the other parameter; otherwise, false.]

to_string

to_string() -> str
to_string(symbol: str) -> str

Returns a string that represents the current object.

Parameters:

Name Type Description Default
symbol Optional[str]

Symbol to use in the string representation of the object

None

Returns:

Type Description
str

Depends on the signature used. Case 1: [A string that represents the current object.]; Case 2: [/// A string that represents the current object.]

__eq__

__eq__(right: SubscriptionDataConfig) -> bool

Override equals operator

__ne__

__ne__(right: SubscriptionDataConfig) -> bool

Override not equals operator

get_hash_code

get_hash_code() -> int

Serves as the default hash function.

Returns:

Type Description
int

A hash code for the current object.