Lean  $LEAN_TAG$
QuantConnect.Data.UniverseSelection.SecurityChanges Class Reference

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

Public Member Functions

 SecurityChanges (SecurityChanges changes)
 Initializes a new instance of the SecurityChanges class as a shallow clone of a given instance, sharing the same collections More...
 
override string ToString ()
 Returns a string that represents the current object. More...
 

Static Public Member Functions

static SecurityChanges operator+ (SecurityChanges left, SecurityChanges right)
 Combines the results of two SecurityChanges More...
 
static SecurityChanges Create (IReadOnlyCollection< Security > additions, IReadOnlyCollection< Security > removals, IReadOnlyCollection< Security > internalAdditions, IReadOnlyCollection< Security > internalRemovals)
 Initializes a new instance of the SecurityChanges class all none internal More...
 

Public Attributes

int Count
 Gets the total count of added and removed securities More...
 
IReadOnlyList< SecurityAddedSecurities
 Gets the symbols that were added by universe selection More...
 
IReadOnlyList< SecurityRemovedSecurities
 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 More...
 

Static Public Attributes

static readonly SecurityChanges None
 Gets an instance that represents no changes have been made More...
 

Properties

bool FilterCustomSecurities [get, set]
 True will filter out custom securities from the AddedSecurities and RemovedSecurities properties More...
 
bool FilterInternalSecurities [get, set]
 True will filter out internal securities from the AddedSecurities and RemovedSecurities properties More...
 

Detailed Description

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

Definition at line 26 of file SecurityChanges.cs.

Constructor & Destructor Documentation

◆ SecurityChanges()

QuantConnect.Data.UniverseSelection.SecurityChanges.SecurityChanges ( SecurityChanges  changes)

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

Parameters
changesThe instance to clone

Definition at line 104 of file SecurityChanges.cs.

Member Function Documentation

◆ operator+()

static SecurityChanges QuantConnect.Data.UniverseSelection.SecurityChanges.operator+ ( SecurityChanges  left,
SecurityChanges  right 
)
static

Combines the results of two SecurityChanges

Parameters
leftThe left side of the operand
rightThe right side of the operand
Returns
Adds the additions together and removes any removals found in the additions, that is, additions take precedence

Definition at line 118 of file SecurityChanges.cs.

◆ Create()

static SecurityChanges QuantConnect.Data.UniverseSelection.SecurityChanges.Create ( IReadOnlyCollection< Security additions,
IReadOnlyCollection< Security removals,
IReadOnlyCollection< Security internalAdditions,
IReadOnlyCollection< Security internalRemovals 
)
static

Initializes a new instance of the SecurityChanges class all none internal

Parameters
additionsAdded symbols list
removalsRemoved symbols list
internalAdditionsInternal added symbols list
internalRemovalsInternal removed symbols list

Useful for testing

Definition at line 143 of file SecurityChanges.cs.

Here is the caller graph for this function:

◆ ToString()

override string QuantConnect.Data.UniverseSelection.SecurityChanges.ToString ( )

Returns a string that represents the current object.

Returns
A string that represents the current object.

<filterpriority>2</filterpriority>

Definition at line 161 of file SecurityChanges.cs.

Member Data Documentation

◆ None

readonly SecurityChanges QuantConnect.Data.UniverseSelection.SecurityChanges.None
static
Initial value:
= new (Enumerable.Empty<Security>(), Enumerable.Empty<Security>(),
Enumerable.Empty<Security>(), Enumerable.Empty<Security>())

Gets an instance that represents no changes have been made

Definition at line 31 of file SecurityChanges.cs.

◆ Count

int QuantConnect.Data.UniverseSelection.SecurityChanges.Count
Initial value:
=> _addedSecurities.Count + _removedSecurities.Count
+ _internalAddedSecurities.Count + _internalRemovedSecurities.Count

Gets the total count of added and removed securities

Definition at line 42 of file SecurityChanges.cs.

◆ AddedSecurities

IReadOnlyList<Security> QuantConnect.Data.UniverseSelection.SecurityChanges.AddedSecurities
Initial value:
=> GetFilteredList(_addedSecurities,
!FilterInternalSecurities ? _internalAddedSecurities : null)

Gets the symbols that were added by universe selection

Will use FilterCustomSecurities value to determine if custom securities should be filtered

Will use FilterInternalSecurities value to determine if internal securities should be filtered

Definition at line 68 of file SecurityChanges.cs.

◆ RemovedSecurities

IReadOnlyList<Security> QuantConnect.Data.UniverseSelection.SecurityChanges.RemovedSecurities
Initial value:
=> GetFilteredList(_removedSecurities,
!FilterInternalSecurities ? _internalRemovedSecurities : null)

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

Will use FilterCustomSecurities value to determine if custom securities should be filtered

Will use FilterInternalSecurities value to determine if internal securities should be filtered

Definition at line 80 of file SecurityChanges.cs.

Property Documentation

◆ FilterCustomSecurities

bool QuantConnect.Data.UniverseSelection.SecurityChanges.FilterCustomSecurities
getset

True will filter out custom securities from the AddedSecurities and RemovedSecurities properties

This allows us to filter but also to disable the filtering if desired

Definition at line 51 of file SecurityChanges.cs.

◆ FilterInternalSecurities

bool QuantConnect.Data.UniverseSelection.SecurityChanges.FilterInternalSecurities
getset

True will filter out internal securities from the AddedSecurities and RemovedSecurities properties

This allows us to filter but also to disable the filtering if desired

Definition at line 59 of file SecurityChanges.cs.


The documentation for this class was generated from the following file: