Skip to content

SecurityService

QuantConnect.Securities.SecurityService

SecurityService(
    cash_book: CashBook,
    market_hours_database: MarketHoursDatabase,
    symbol_properties_database: SymbolPropertiesDatabase,
    security_initializer_provider: ISecurityInitializerProvider,
    registered_types: IRegisteredSecurityDataTypesProvider,
    cache_provider: SecurityCacheProvider,
    primary_exchange_provider: IPrimaryExchangeProvider = None,
    algorithm: IAlgorithm = None,
)

Bases: Object, ISecurityService

This class implements interface ISecurityService providing methods for creating new Security

Creates a new instance of the SecurityService class

create_security

create_security(
    symbol: Union[Symbol, str, BaseContract],
    subscription_data_config_list: List[
        SubscriptionDataConfig
    ],
    leverage: float = 0,
    add_to_symbol_cache: bool = True,
    underlying: Security = None,
    seed_security: bool = True,
) -> Security
create_security(
    symbol: Union[Symbol, str, BaseContract],
    subscription_data_config: SubscriptionDataConfig,
    leverage: float = 0,
    add_to_symbol_cache: bool = True,
    underlying: Security = None,
    seed_security: bool = True,
) -> Security

Creates a new security

create_benchmark_security

create_benchmark_security(
    symbol: Union[Symbol, str, BaseContract],
) -> Security

Creates a new security

set_live_mode

set_live_mode(is_live_mode: bool) -> None

Set live mode state of the algorithm

Parameters:

Name Type Description Default
is_live_mode bool

True, live mode is enabled

required