Lean
$LEAN_TAG$
|
Manages the algorithm's collection of universes More...
Public Member Functions | |
UniverseManager () | |
Initializes a new instance of the UniverseManager class More... | |
IEnumerator< KeyValuePair< Symbol, Universe > > | GetEnumerator () |
Returns an enumerator that iterates through the collection. More... | |
void | Add (KeyValuePair< Symbol, Universe > item) |
Adds an item to the T:System.Collections.Generic.ICollection`1. More... | |
void | Clear () |
Removes all items from the T:System.Collections.Generic.ICollection`1. More... | |
bool | Contains (KeyValuePair< Symbol, Universe > item) |
Determines whether the T:System.Collections.Generic.ICollection`1 contains a specific value. More... | |
void | CopyTo (KeyValuePair< Symbol, Universe >[] array, int arrayIndex) |
Copies the elements of the T:System.Collections.Generic.ICollection`1 to an T:System.Array, starting at a particular T:System.Array index. More... | |
bool | Remove (KeyValuePair< Symbol, Universe > item) |
Removes the first occurrence of a specific object from the T:System.Collections.Generic.ICollection`1. More... | |
bool | ContainsKey (Symbol key) |
Determines whether the T:System.Collections.Generic.IDictionary`2 contains an element with the specified key. More... | |
void | Add (Symbol key, Universe value) |
Adds an element with the provided key and value to the System.Collections.Generic.IDictionary<TKey, TValue>. More... | |
void | ProcessChanges () |
Will trigger collection changed event if required More... | |
bool | Remove (Symbol key) |
Removes the element with the specified key from the T:System.Collections.Generic.IDictionary`2. More... | |
bool | TryGetValue (Symbol key, out Universe value) |
Gets the value associated with the specified key. More... | |
Public Attributes | |
IReadOnlyDictionary< Symbol, Security > | ActiveSecurities |
Read-only dictionary containing all active securities. An active security is a security that is currently selected by the universe or has holdings or open orders. More... | |
int | Count => _universes.Skip(0).Count() |
Gets the number of elements contained in the T:System.Collections.Generic.ICollection`1. More... | |
ICollection< Symbol > | Keys => _universes.Select(x => x.Key).ToList() |
Gets an T:System.Collections.Generic.ICollection`1 containing the keys of the T:System.Collections.Generic.IDictionary`2. More... | |
ICollection< Universe > | Values => _universes.Select(x => x.Value).ToList() |
Gets an T:System.Collections.Generic.ICollection`1 containing the values in the T:System.Collections.Generic.IDictionary`2. More... | |
Protected Member Functions | |
virtual void | OnCollectionChanged (NotifyCollectionChangedEventArgs e) |
Event invocator for the CollectionChanged event More... | |
Properties | |
bool | IsReadOnly [get] |
Gets a value indicating whether the T:System.Collections.Generic.ICollection`1 is read-only. More... | |
Universe | this[Symbol symbol] [get, set] |
Gets or sets the element with the specified key. More... | |
Events | |
NotifyCollectionChangedEventHandler | CollectionChanged |
Event fired when a universe is added or removed More... | |
Manages the algorithm's collection of universes
Definition at line 30 of file UniverseManager.cs.
QuantConnect.Securities.UniverseManager.UniverseManager | ( | ) |
Initializes a new instance of the UniverseManager class
Definition at line 51 of file UniverseManager.cs.
IEnumerator<KeyValuePair<Symbol, Universe> > QuantConnect.Securities.UniverseManager.GetEnumerator | ( | ) |
Returns an enumerator that iterates through the collection.
<filterpriority>1</filterpriority>
Definition at line 65 of file UniverseManager.cs.
Adds an item to the T:System.Collections.Generic.ICollection`1.
item | The object to add to the T:System.Collections.Generic.ICollection`1. |
T:System.NotSupportedException | The T:System.Collections.Generic.ICollection`1 is read-only. |
Definition at line 86 of file UniverseManager.cs.
void QuantConnect.Securities.UniverseManager.Clear | ( | ) |
Removes all items from the T:System.Collections.Generic.ICollection`1.
T:System.NotSupportedException | The T:System.Collections.Generic.ICollection`1 is read-only. |
Definition at line 95 of file UniverseManager.cs.
Determines whether the T:System.Collections.Generic.ICollection`1 contains a specific value.
item | The object to locate in the T:System.Collections.Generic.ICollection`1. |
Definition at line 107 of file UniverseManager.cs.
void QuantConnect.Securities.UniverseManager.CopyTo | ( | KeyValuePair< Symbol, Universe >[] | array, |
int | arrayIndex | ||
) |
Copies the elements of the T:System.Collections.Generic.ICollection`1 to an T:System.Array, starting at a particular T:System.Array index.
array | The one-dimensional T:System.Array that is the destination of the elements copied from T:System.Collections.Generic.ICollection`1. The T:System.Array must have zero-based indexing. |
arrayIndex | The zero-based index in array at which copying begins. |
T:System.ArgumentNullException | array is null. |
T:System.ArgumentOutOfRangeException | arrayIndex is less than 0. |
T:System.ArgumentException | The number of elements in the source T:System.Collections.Generic.ICollection`1 is greater than the available space from arrayIndex to the end of the destination array . |
Definition at line 116 of file UniverseManager.cs.
Removes the first occurrence of a specific object from the T:System.Collections.Generic.ICollection`1.
item | The object to remove from the T:System.Collections.Generic.ICollection`1. |
T:System.NotSupportedException | The T:System.Collections.Generic.ICollection`1 is read-only. |
Definition at line 128 of file UniverseManager.cs.
bool QuantConnect.Securities.UniverseManager.ContainsKey | ( | Symbol | key | ) |
Determines whether the T:System.Collections.Generic.IDictionary`2 contains an element with the specified key.
key | The key to locate in the T:System.Collections.Generic.IDictionary`2. |
T:System.ArgumentNullException | key is null. |
Definition at line 159 of file UniverseManager.cs.
Adds an element with the provided key and value to the System.Collections.Generic.IDictionary<TKey, TValue>.
key | The object to use as the key of the element to add. |
value | The object to use as the value of the element to add. |
System.ArgumentNullException | key is null. |
System.ArgumentException | An element with the same key already exists in the System.Collections.Generic.IDictionary<TKey, TValue>. |
System.NotSupportedException | The System.Collections.Generic.IDictionary<TKey, TValue> is read-only. |
Definition at line 172 of file UniverseManager.cs.
void QuantConnect.Securities.UniverseManager.ProcessChanges | ( | ) |
Will trigger collection changed event if required
Definition at line 186 of file UniverseManager.cs.
bool QuantConnect.Securities.UniverseManager.Remove | ( | Symbol | key | ) |
Removes the element with the specified key from the T:System.Collections.Generic.IDictionary`2.
key | The key of the element to remove. |
T:System.ArgumentNullException | key is null. |
T:System.NotSupportedException | The T:System.Collections.Generic.IDictionary`2 is read-only. |
Definition at line 211 of file UniverseManager.cs.
Gets the value associated with the specified key.
key | The key whose value to get. |
value | When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
T:System.ArgumentNullException | key is null. |
Definition at line 230 of file UniverseManager.cs.
|
protectedvirtual |
Event invocator for the CollectionChanged event
e |
Definition at line 290 of file UniverseManager.cs.
Read-only dictionary containing all active securities. An active security is a security that is currently selected by the universe or has holdings or open orders.
Definition at line 44 of file UniverseManager.cs.
int QuantConnect.Securities.UniverseManager.Count => _universes.Skip(0).Count() |
Gets the number of elements contained in the T:System.Collections.Generic.ICollection`1.
Definition at line 139 of file UniverseManager.cs.
ICollection<Symbol> QuantConnect.Securities.UniverseManager.Keys => _universes.Select(x => x.Key).ToList() |
Gets an T:System.Collections.Generic.ICollection`1 containing the keys of the T:System.Collections.Generic.IDictionary`2.
Definition at line 274 of file UniverseManager.cs.
ICollection<Universe> QuantConnect.Securities.UniverseManager.Values => _universes.Select(x => x.Value).ToList() |
Gets an T:System.Collections.Generic.ICollection`1 containing the values in the T:System.Collections.Generic.IDictionary`2.
Definition at line 282 of file UniverseManager.cs.
|
get |
Gets a value indicating whether the T:System.Collections.Generic.ICollection`1 is read-only.
Definition at line 148 of file UniverseManager.cs.
Gets or sets the element with the specified key.
symbol | The key of the element to get or set. |
T:System.ArgumentNullException | symbol is null. |
T:System.Collections.Generic.KeyNotFoundException | The property is retrieved and symbol is not found. |
T:System.NotSupportedException | The property is set and the T:System.Collections.Generic.IDictionary`2 is read-only. |
Definition at line 243 of file UniverseManager.cs.
NotifyCollectionChangedEventHandler QuantConnect.Securities.UniverseManager.CollectionChanged |
Event fired when a universe is added or removed
Definition at line 38 of file UniverseManager.cs.