Lean
$LEAN_TAG$
|
Provides a base class for types holding base data instances keyed by symbol More...
Public Member Functions | |
DataDictionary () | |
Initializes a new instance of the QuantConnect.Data.Market.DataDictionary<T> class. More... | |
DataDictionary (IEnumerable< T > data, Func< T, Symbol > keySelector) | |
Initializes a new instance of the QuantConnect.Data.Market.DataDictionary<T> class using the specified data as a data source More... | |
DataDictionary (DateTime time) | |
Initializes a new instance of the QuantConnect.Data.Market.DataDictionary<T> class. More... | |
IEnumerator< KeyValuePair< Symbol, T > > | GetEnumerator () |
Returns an enumerator that iterates through the collection. More... | |
void | Add (KeyValuePair< Symbol, T > item) |
Adds an item to the T:System.Collections.Generic.ICollection`1. More... | |
override void | Clear () |
Removes all items from the T:System.Collections.Generic.ICollection`1. More... | |
bool | Contains (KeyValuePair< Symbol, T > item) |
Determines whether the T:System.Collections.Generic.ICollection`1 contains a specific value. More... | |
void | CopyTo (KeyValuePair< Symbol, T >[] 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, T > 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 System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the specified key. More... | |
void | Add (Symbol key, T value) |
Adds an element with the provided key and value to the System.Collections.Generic.IDictionary<TKey, TValue>. More... | |
override bool | Remove (Symbol key) |
Removes the element with the specified key from the System.Collections.Generic.IDictionary<TKey, TValue>. More... | |
override bool | TryGetValue (Symbol key, out T value) |
Gets the value associated with the specified key. More... | |
virtual T | GetValue (Symbol key) |
Gets the value associated with the specified key. More... | |
Public Member Functions inherited from QuantConnect.ExtendedDictionary< T > | |
void | clear () |
Removes all keys and values from the IExtendedDictionary<TKey, TValue>. More... | |
PyDict | copy () |
Creates a shallow copy of the IExtendedDictionary<TKey, TValue>. More... | |
PyDict | fromkeys (Symbol[] sequence) |
Creates a new dictionary from the given sequence of elements. More... | |
PyDict | fromkeys (Symbol[] sequence, T value) |
Creates a new dictionary from the given sequence of elements with a value provided by the user. More... | |
T | get (Symbol symbol) |
Returns the value for the specified Symbol if Symbol is in dictionary. More... | |
T | get (Symbol symbol, T value) |
Returns the value for the specified Symbol if Symbol is in dictionary. More... | |
PyList | items () |
Returns a view object that displays a list of dictionary's (Symbol, value) tuple pairs. More... | |
PyTuple | popitem () |
Returns and removes an arbitrary element (Symbol, value) pair from the dictionary. More... | |
T | setdefault (Symbol symbol) |
Returns the value of a Symbol (if the Symbol is in dictionary). If not, it inserts Symbol with a value to the dictionary. More... | |
T | setdefault (Symbol symbol, T default_value) |
Returns the value of a Symbol (if the Symbol is in dictionary). If not, it inserts Symbol with a value to the dictionary. More... | |
T | pop (Symbol symbol) |
Removes and returns an element from a dictionary having the given Symbol. More... | |
T | pop (Symbol symbol, T default_value) |
Removes and returns an element from a dictionary having the given Symbol. More... | |
void | update (PyObject other) |
Updates the dictionary with the elements from the another dictionary object or from an iterable of Symbol/value pairs. The update() method adds element(s) to the dictionary if the Symbol is not in the dictionary.If the Symbol is in the dictionary, it updates the Symbol with the new value. More... | |
PyList | keys () |
Returns a view object that displays a list of all the Symbol objects in the dictionary More... | |
PyList | values () |
Returns a view object that displays a list of all the values in the dictionary. More... | |
Public Member Functions inherited from QuantConnect.Interfaces.IExtendedDictionary< Symbol, T > | |
void | clear () |
Removes all keys and values from the IExtendedDictionary<TKey, TValue>. More... | |
PyDict | copy () |
Creates a shallow copy of the IExtendedDictionary<TKey, TValue>. More... | |
PyDict | fromkeys (TKey[] sequence) |
Creates a new dictionary from the given sequence of elements. More... | |
PyDict | fromkeys (TKey[] sequence, TValue value) |
Creates a new dictionary from the given sequence of elements with a value provided by the user. More... | |
TValue | get (TKey key) |
Returns the value for the specified key if key is in dictionary. More... | |
TValue | get (TKey key, TValue value) |
Returns the value for the specified key if key is in dictionary. More... | |
PyList | items () |
Returns a view object that displays a list of dictionary's (key, value) tuple pairs. More... | |
PyList | keys () |
Returns a view object that displays a list of all the keys in the dictionary More... | |
PyTuple | popitem () |
Returns and removes an arbitrary element (key, value) pair from the dictionary. More... | |
TValue | setdefault (TKey key) |
Returns the value of a key (if the key is in dictionary). If not, it inserts key with a value to the dictionary. More... | |
TValue | setdefault (TKey key, TValue default_value) |
Returns the value of a key (if the key is in dictionary). If not, it inserts key with a value to the dictionary. More... | |
TValue | pop (TKey key) |
Removes and returns an element from a dictionary having the given key. More... | |
TValue | pop (TKey key, TValue default_value) |
Removes and returns an element from a dictionary having the given key. More... | |
void | update (PyObject other) |
Updates the dictionary with the elements from the another dictionary object or from an iterable of key/value pairs. The update() method adds element(s) to the dictionary if the key is not in the dictionary.If the key is in the dictionary, it updates the key with the new value. More... | |
PyList | values () |
Returns a view object that displays a list of all the values in the dictionary. More... | |
Protected Attributes | |
override IEnumerable< Symbol > | GetKeys => Keys |
Gets an T:System.Collections.Generic.ICollection`1 containing the Symbol objects of the T:System.Collections.Generic.IDictionary`2. More... | |
override IEnumerable< T > | GetValues => Values |
Gets an T:System.Collections.Generic.ICollection`1 containing the values in the T:System.Collections.Generic.IDictionary`2. More... | |
Properties | |
DateTime | Time [get, set] |
Gets or sets the time associated with this collection of data More... | |
int | Count [get] |
Gets the number of elements contained in the T:System.Collections.Generic.ICollection`1. More... | |
override bool | IsReadOnly [get] |
Gets a value indicating whether the T:System.Collections.Generic.ICollection`1 is read-only. More... | |
override T | this[Symbol symbol] [get, set] |
Gets or sets the element with the specified key. More... | |
ICollection< Symbol > | Keys [get] |
Gets an T:System.Collections.Generic.ICollection`1 containing the keys of the T:System.Collections.Generic.IDictionary`2. More... | |
ICollection< T > | Values [get] |
Gets an T:System.Collections.Generic.ICollection`1 containing the values in the T:System.Collections.Generic.IDictionary`2. More... | |
Properties inherited from QuantConnect.ExtendedDictionary< T > | |
abstract IEnumerable< Symbol > | GetKeys [get] |
Gets an T:System.Collections.Generic.ICollection`1 containing the Symbol objects of the T:System.Collections.Generic.IDictionary`2. More... | |
abstract IEnumerable< T > | GetValues [get] |
Gets an T:System.Collections.Generic.ICollection`1 containing the values in the T:System.Collections.Generic.IDictionary`2. More... | |
virtual T | this[Symbol symbol] [get, set] |
Indexer method for the base dictioanry to access the objects by their symbol. More... | |
virtual T | this[string ticker] [get, set] |
Indexer method for the base dictioanry to access the objects by their symbol. More... | |
Additional Inherited Members | |
Public Attributes inherited from QuantConnect.ExtendedDictionary< T > | |
virtual bool | IsReadOnly => true |
Gets a value indicating whether the IDictionary object is read-only. More... | |
Provides a base class for types holding base data instances keyed by symbol
Definition at line 27 of file DataDictionary.cs.
Initializes a new instance of the QuantConnect.Data.Market.DataDictionary<T> class.
Definition at line 35 of file DataDictionary.cs.
QuantConnect.Data.Market.DataDictionary< T >.DataDictionary | ( | IEnumerable< T > | data, |
Func< T, Symbol > | keySelector | ||
) |
Initializes a new instance of the QuantConnect.Data.Market.DataDictionary<T> class using the specified data as a data source
data | The data source for this data dictionary |
keySelector | Delegate used to select a key from the value |
Definition at line 45 of file DataDictionary.cs.
QuantConnect.Data.Market.DataDictionary< T >.DataDictionary | ( | DateTime | time | ) |
Initializes a new instance of the QuantConnect.Data.Market.DataDictionary<T> class.
time | The time this data was emitted. |
Definition at line 57 of file DataDictionary.cs.
IEnumerator<KeyValuePair<Symbol, T> > QuantConnect.Data.Market.DataDictionary< T >.GetEnumerator | ( | ) |
Returns an enumerator that iterates through the collection.
<filterpriority>1</filterpriority>
Definition at line 76 of file DataDictionary.cs.
void QuantConnect.Data.Market.DataDictionary< T >.Add | ( | KeyValuePair< Symbol, T > | item | ) |
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 96 of file DataDictionary.cs.
|
virtual |
Removes all items from the T:System.Collections.Generic.ICollection`1.
T:System.NotSupportedException | The T:System.Collections.Generic.ICollection`1 is read-only. |
Reimplemented from QuantConnect.ExtendedDictionary< T >.
Definition at line 105 of file DataDictionary.cs.
bool QuantConnect.Data.Market.DataDictionary< T >.Contains | ( | KeyValuePair< Symbol, T > | item | ) |
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 117 of file DataDictionary.cs.
void QuantConnect.Data.Market.DataDictionary< T >.CopyTo | ( | KeyValuePair< Symbol, T >[] | 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 126 of file DataDictionary.cs.
bool QuantConnect.Data.Market.DataDictionary< T >.Remove | ( | KeyValuePair< Symbol, T > | item | ) |
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 138 of file DataDictionary.cs.
bool QuantConnect.Data.Market.DataDictionary< T >.ContainsKey | ( | Symbol | key | ) |
Determines whether the System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the specified key.
key | The key to locate in the System.Collections.Generic.IDictionary<TKey, TValue>. |
System.ArgumentNullException | key is null. |
Definition at line 172 of file DataDictionary.cs.
void QuantConnect.Data.Market.DataDictionary< T >.Add | ( | Symbol | key, |
T | value | ||
) |
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. |
T:System.ArgumentException | An element with the same key already exists in the T:System.Collections.Generic.IDictionary`2. |
T:System.NotSupportedException | The T:System.Collections.Generic.IDictionary`2 is read-only. |
Definition at line 181 of file DataDictionary.cs.
|
virtual |
Removes the element with the specified key from the System.Collections.Generic.IDictionary<TKey, TValue>.
key | The key of the element to remove. |
System.ArgumentNullException | key is null. |
System.NotSupportedException | The System.Collections.Generic.IDictionary<TKey, TValue> is read-only. |
Reimplemented from QuantConnect.ExtendedDictionary< T >.
Definition at line 193 of file DataDictionary.cs.
|
virtual |
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. |
Implements QuantConnect.ExtendedDictionary< T >.
Definition at line 205 of file DataDictionary.cs.
|
virtual |
Gets the value associated with the specified key.
key | The key whose value to get. |
Definition at line 282 of file DataDictionary.cs.
|
protected |
Gets an T:System.Collections.Generic.ICollection`1 containing the Symbol objects of the T:System.Collections.Generic.IDictionary`2.
Definition at line 265 of file DataDictionary.cs.
|
protected |
Gets an T:System.Collections.Generic.ICollection`1 containing the values in the T:System.Collections.Generic.IDictionary`2.
Definition at line 273 of file DataDictionary.cs.
|
getset |
Gets or sets the time associated with this collection of data
Definition at line 67 of file DataDictionary.cs.
|
get |
Gets the number of elements contained in the T:System.Collections.Generic.ICollection`1.
Definition at line 150 of file DataDictionary.cs.
|
get |
Gets a value indicating whether the T:System.Collections.Generic.ICollection`1 is read-only.
Definition at line 161 of file DataDictionary.cs.
|
getset |
Gets or sets the element with the specified key.
symbol | The key of the element to get or set. |
System.ArgumentNullException | symbol is null. |
System.Collections.Generic.KeyNotFoundException | The property is retrieved and symbol is not found. |
System.NotSupportedException | The property is set and the System.Collections.Generic.IDictionary<TKey, TValue> is read-only. |
Definition at line 221 of file DataDictionary.cs.
|
get |
Gets an T:System.Collections.Generic.ICollection`1 containing the keys of the T:System.Collections.Generic.IDictionary`2.
Definition at line 244 of file DataDictionary.cs.
|
get |
Gets an T:System.Collections.Generic.ICollection`1 containing the values in the T:System.Collections.Generic.IDictionary`2.
Definition at line 255 of file DataDictionary.cs.