Skip to content

CurrencySubscriptionDataConfigManager

QuantConnect.Lean.Engine.DataFeeds.CurrencySubscriptionDataConfigManager

CurrencySubscriptionDataConfigManager(
    cash_book: CashBook,
    security_manager: SecurityManager,
    subscription_manager: SubscriptionManager,
    security_service: ISecurityService,
    default_resolution: Resolution,
)

Bases: Object

Helper class to keep track of required internal currency SubscriptionDataConfig. This class is used by the UniverseSelection

Creates a new instance

Parameters:

Name Type Description Default
cash_book CashBook

The cash book instance

required
security_manager SecurityManager

The SecurityManager, required by the cash book for creating new securities

required
subscription_manager SubscriptionManager

The SubscriptionManager, required by the cash book for creating new subscription data configs

required
security_service ISecurityService

The SecurityService, required by the cash book for creating new securities

required
default_resolution Resolution

The default resolution to use for the internal subscriptions

required

ensure_currency_subscription_data_configs

ensure_currency_subscription_data_configs(
    security_changes: SecurityChanges,
    brokerage_model: IBrokerageModel,
) -> None

Checks the current SubscriptionDataConfig and adds new necessary currency pair feeds to provide real time conversion data

get_pending_subscription_data_configs

get_pending_subscription_data_configs() -> (
    Iterable[SubscriptionDataConfig]
)

Will return any pending internal currency SubscriptionDataConfig and remove them as pending.

Returns:

Type Description
Iterable[SubscriptionDataConfig]

Will return the SubscriptionDataConfig to be added.

get_subscription_data_config_to_remove

get_subscription_data_config_to_remove(
    added_symbol: Union[Symbol, str, BaseContract],
) -> SubscriptionDataConfig

Will verify if there are any SubscriptionDataConfig to be removed for a given added Symbol.

Parameters:

Name Type Description Default
added_symbol Union[Symbol, str, BaseContract]

The symbol that was added to the data feed system

required

Returns:

Type Description
SubscriptionDataConfig

The SubscriptionDataConfig to be removed, null if none.

update_pending_subscription_data_configs

update_pending_subscription_data_configs(
    brokerage_model: IBrokerageModel,
) -> bool

Will update pending currency SubscriptionDataConfig

Returns:

Type Description
bool

True when there are pending currency subscriptions get_pending_subscription_data_configs.