Lean  $LEAN_TAG$
QuantConnect.Data.UniverseSelection.Universe Class Referenceabstract

Provides a base class for all universes to derive from. More...

Inheritance diagram for QuantConnect.Data.UniverseSelection.Universe:
[legend]

Classes

class  Member
 Member of the Universe More...
 
class  SelectionEventArgs
 Event fired when the universe selection changes More...
 
class  UnchangedUniverse
 Provides a value to indicate that no changes should be made to the universe. This value is intended to be returned by reference via Universe.SelectSymbols More...
 

Public Member Functions

virtual bool CanRemoveMember (DateTime utcTime, Security security)
 Determines whether or not the specified security can be removed from this universe. This is useful to prevent securities from being taken out of a universe before the algorithm has had enough time to make decisions on the security More...
 
IEnumerable< SymbolPerformSelection (DateTime utcTime, BaseDataCollection data)
 Performs universe selection using the data specified More...
 
abstract IEnumerable< SymbolSelectSymbols (DateTime utcTime, BaseDataCollection data)
 Performs universe selection using the data specified More...
 
virtual Security CreateSecurity (Symbol symbol, IAlgorithm algorithm, MarketHoursDatabase marketHoursDatabase, SymbolPropertiesDatabase symbolPropertiesDatabase)
 Creates and configures a security for the specified symbol More...
 
virtual IEnumerable< SubscriptionRequestGetSubscriptionRequests (Security security, DateTime currentTimeUtc, DateTime maximumEndTimeUtc)
 Gets the subscription requests to be added for the specified security More...
 
virtual IEnumerable< SubscriptionRequestGetSubscriptionRequests (Security security, DateTime currentTimeUtc, DateTime maximumEndTimeUtc, ISubscriptionDataConfigService subscriptionService)
 Gets the subscription requests to be added for the specified security More...
 
bool ContainsMember (Symbol symbol)
 Determines whether or not the specified symbol is currently a member of this universe More...
 
virtual void Dispose ()
 Marks this universe as disposed and ready to remove all child subscriptions More...
 

Static Public Attributes

static readonly UnchangedUniverse Unchanged = UnchangedUniverse.Instance
 Gets a value indicating that no change to the universe should be made More...
 

Protected Member Functions

 Universe (SubscriptionDataConfig config)
 Initializes a new instance of the Universe class More...
 
void OnSelectionChanged (HashSet< Symbol > selection=null)
 Event invocator for the SelectionChanged event More...
 

Properties

virtual ConcurrentDictionary< Symbol, MemberSecurities [get]
 Gets the internal security collection used to define membership in this universe More...
 
SecurityType SecurityType [get]
 Gets the security type of this universe More...
 
string Market [get]
 Gets the market of this universe More...
 
virtual bool DisposeRequested [get, protected set]
 Flag indicating if disposal of this universe has been requested More...
 
abstract UniverseSettings UniverseSettings [get]
 Gets the settings used for subscriptions added for this universe More...
 
virtual SubscriptionDataConfig Configuration [get]
 Gets the configuration used to get universe data More...
 
Dictionary< Symbol, SecurityMembers [get]
 Gets the current listing of members in this universe. Modifications to this dictionary do not change universe membership. More...
 

Events

EventHandler SelectionChanged
 Event fired when the universe selection has changed More...
 

Detailed Description

Provides a base class for all universes to derive from.

Definition at line 30 of file Universe.cs.

Constructor & Destructor Documentation

◆ Universe()

QuantConnect.Data.UniverseSelection.Universe.Universe ( SubscriptionDataConfig  config)
protected

Initializes a new instance of the Universe class

Parameters
configThe configuration used to source data for this universe

Definition at line 113 of file Universe.cs.

Here is the caller graph for this function:

Member Function Documentation

◆ CanRemoveMember()

virtual bool QuantConnect.Data.UniverseSelection.Universe.CanRemoveMember ( DateTime  utcTime,
Security  security 
)
virtual

Determines whether or not the specified security can be removed from this universe. This is useful to prevent securities from being taken out of a universe before the algorithm has had enough time to make decisions on the security

Parameters
utcTimeThe current utc time
securityThe security to check if its ok to remove
Returns
True if we can remove the security, false otherwise

Reimplemented in QuantConnect.Data.UniverseSelection.UniverseDecorator.

Definition at line 130 of file Universe.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PerformSelection()

IEnumerable<Symbol> QuantConnect.Data.UniverseSelection.Universe.PerformSelection ( DateTime  utcTime,
BaseDataCollection  data 
)

Performs universe selection using the data specified

Parameters
utcTimeThe current utc time
dataThe symbols to remain in the universe
Returns
The data that passes the filter

Definition at line 177 of file Universe.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SelectSymbols()

abstract IEnumerable<Symbol> QuantConnect.Data.UniverseSelection.Universe.SelectSymbols ( DateTime  utcTime,
BaseDataCollection  data 
)
pure virtual

◆ CreateSecurity()

virtual Security QuantConnect.Data.UniverseSelection.Universe.CreateSecurity ( Symbol  symbol,
IAlgorithm  algorithm,
MarketHoursDatabase  marketHoursDatabase,
SymbolPropertiesDatabase  symbolPropertiesDatabase 
)
virtual

Creates and configures a security for the specified symbol

Parameters
symbolThe symbol of the security to be created
algorithmThe algorithm instance
marketHoursDatabaseThe market hours database
symbolPropertiesDatabaseThe symbol properties database
Returns
The newly initialized security object

<obsolete>The CreateSecurity won't be called</obsolete>

Reimplemented in QuantConnect.Data.UniverseSelection.UniverseDecorator.

Definition at line 224 of file Universe.cs.

Here is the caller graph for this function:

◆ GetSubscriptionRequests() [1/2]

virtual IEnumerable<SubscriptionRequest> QuantConnect.Data.UniverseSelection.Universe.GetSubscriptionRequests ( Security  security,
DateTime  currentTimeUtc,
DateTime  maximumEndTimeUtc 
)
virtual

Gets the subscription requests to be added for the specified security

Parameters
securityThe security to get subscriptions for
currentTimeUtcThe current time in utc. This is the frontier time of the algorithm
maximumEndTimeUtcThe max end time
Returns
All subscriptions required by this security

Reimplemented in QuantConnect.Data.UniverseSelection.UniverseDecorator, and QuantConnect.Data.UniverseSelection.GetSubscriptionRequestsUniverseDecorator.

Definition at line 238 of file Universe.cs.

Here is the caller graph for this function:

◆ GetSubscriptionRequests() [2/2]

virtual IEnumerable<SubscriptionRequest> QuantConnect.Data.UniverseSelection.Universe.GetSubscriptionRequests ( Security  security,
DateTime  currentTimeUtc,
DateTime  maximumEndTimeUtc,
ISubscriptionDataConfigService  subscriptionService 
)
virtual

Gets the subscription requests to be added for the specified security

Parameters
securityThe security to get subscriptions for
currentTimeUtcThe current time in utc. This is the frontier time of the algorithm
maximumEndTimeUtcThe max end time
subscriptionServiceInstance which implements ISubscriptionDataConfigService interface
Returns
All subscriptions required by this security

Reimplemented in QuantConnect.Data.UniverseSelection.UserDefinedUniverse, QuantConnect.Data.UniverseSelection.OptionChainUniverse, QuantConnect.Data.UniverseSelection.UniversePythonWrapper, QuantConnect.Data.UniverseSelection.ContinuousContractUniverse, QuantConnect.Data.UniverseSelection.FuturesChainUniverse, QuantConnect.Data.UniverseSelection.UniverseDecorator, QuantConnect.Algorithm.Framework.Selection.ManualUniverse, and QuantConnect.Algorithm.Framework.Selection.CustomUniverse.

Definition at line 253 of file Universe.cs.

Here is the call graph for this function:

◆ ContainsMember()

bool QuantConnect.Data.UniverseSelection.Universe.ContainsMember ( Symbol  symbol)

Determines whether or not the specified symbol is currently a member of this universe

Parameters
symbolThe symbol whose membership is to be checked
Returns
True if the specified symbol is part of this universe, false otherwise

Definition at line 279 of file Universe.cs.

Here is the caller graph for this function:

◆ Dispose()

virtual void QuantConnect.Data.UniverseSelection.Universe.Dispose ( )
virtual

Marks this universe as disposed and ready to remove all child subscriptions

Definition at line 330 of file Universe.cs.

Here is the caller graph for this function:

◆ OnSelectionChanged()

void QuantConnect.Data.UniverseSelection.Universe.OnSelectionChanged ( HashSet< Symbol selection = null)
protected

Event invocator for the SelectionChanged event

Parameters
selectionThe current universe selection

Definition at line 339 of file Universe.cs.

Here is the caller graph for this function:

Member Data Documentation

◆ Unchanged

readonly UnchangedUniverse QuantConnect.Data.UniverseSelection.Universe.Unchanged = UnchangedUniverse.Instance
static

Gets a value indicating that no change to the universe should be made

Definition at line 41 of file Universe.cs.

Property Documentation

◆ Securities

virtual ConcurrentDictionary<Symbol, Member> QuantConnect.Data.UniverseSelection.Universe.Securities
get

Gets the internal security collection used to define membership in this universe

Definition at line 49 of file Universe.cs.

◆ SecurityType

SecurityType QuantConnect.Data.UniverseSelection.Universe.SecurityType
get

Gets the security type of this universe

Definition at line 63 of file Universe.cs.

◆ Market

string QuantConnect.Data.UniverseSelection.Universe.Market
get

Gets the market of this universe

Definition at line 71 of file Universe.cs.

◆ DisposeRequested

virtual bool QuantConnect.Data.UniverseSelection.Universe.DisposeRequested
getprotected set

Flag indicating if disposal of this universe has been requested

Definition at line 79 of file Universe.cs.

◆ UniverseSettings

abstract UniverseSettings QuantConnect.Data.UniverseSelection.Universe.UniverseSettings
get

Gets the settings used for subscriptions added for this universe

Definition at line 88 of file Universe.cs.

◆ Configuration

virtual SubscriptionDataConfig QuantConnect.Data.UniverseSelection.Universe.Configuration
get

Gets the configuration used to get universe data

Definition at line 96 of file Universe.cs.

◆ Members

Dictionary<Symbol, Security> QuantConnect.Data.UniverseSelection.Universe.Members
get

Gets the current listing of members in this universe. Modifications to this dictionary do not change universe membership.

Definition at line 105 of file Universe.cs.

Event Documentation

◆ SelectionChanged

EventHandler QuantConnect.Data.UniverseSelection.Universe.SelectionChanged

Event fired when the universe selection has changed

Definition at line 57 of file Universe.cs.


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