Skip to content

SecurityChanges

QuantConnect.Data.UniverseSelection.SecurityChanges

SecurityChanges(changes: SecurityChanges)

Bases: Object

Defines the additions and subtractions to the algorithm's security subscriptions

Initializes a new instance of the SecurityChanges class as a shallow clone of a given instance, sharing the same collections

Parameters:

Name Type Description Default
changes SecurityChanges

The instance to clone

required

NONE

NONE: SecurityChanges = ...

Gets an instance that represents no changes have been made

count

count: int

Gets the total count of added and removed securities

filter_custom_securities

filter_custom_securities: bool

True will filter out custom securities from the added_securities and removed_securities properties

filter_internal_securities

filter_internal_securities: bool

True will filter out internal securities from the added_securities and removed_securities properties

added_securities

added_securities: Sequence[Security]

Gets the symbols that were added by universe selection

removed_securities

removed_securities: Sequence[Security]

Gets the symbols that were removed by universe selection. This list may include symbols that were removed, but are still receiving data due to existing holdings or open orders

__add__

__add__(right: SecurityChanges) -> SecurityChanges

Combines the results of two SecurityChanges

Parameters:

Name Type Description Default
right SecurityChanges

The right side of the operand

required

Returns:

Type Description
SecurityChanges

Adds the additions together and removes any removals found in the additions, that is, additions take precedence.

__iadd__

__iadd__(right: SecurityChanges) -> SecurityChanges

Combines the results of two SecurityChanges

Parameters:

Name Type Description Default
right SecurityChanges

The right side of the operand

required

Returns:

Type Description
SecurityChanges

Adds the additions together and removes any removals found in the additions, that is, additions take precedence.

create

create(
    additions: Sequence[Security],
    removals: Sequence[Security],
    internal_additions: Sequence[Security],
    internal_removals: Sequence[Security],
) -> SecurityChanges

Initializes a new instance of the SecurityChanges class all none internal

Parameters:

Name Type Description Default
additions Sequence[Security]

Added symbols list

required
removals Sequence[Security]

Removed symbols list

required
internal_additions Sequence[Security]

Internal added symbols list

required
internal_removals Sequence[Security]

Internal removed symbols list

required

to_string

to_string() -> str

Returns a string that represents the current object.

Returns:

Type Description
str

A string that represents the current object.