Lean
$LEAN_TAG$
|
Provides a data structure for all of an algorithm's data at a single time step More...
Public Member Functions | |
Slice (DateTime time, IEnumerable< BaseData > data, DateTime utcTime) | |
Initializes a new instance of the Slice class, lazily instantiating the Slice.Bars and Slice.Ticks collections on demand More... | |
Slice (DateTime time, List< BaseData > data, DateTime utcTime) | |
Initializes a new instance of the Slice class, lazily instantiating the Slice.Bars and Slice.Ticks collections on demand More... | |
Slice (DateTime time, List< BaseData > data, TradeBars tradeBars, QuoteBars quoteBars, Ticks ticks, OptionChains optionChains, FuturesChains futuresChains, Splits splits, Dividends dividends, Delistings delistings, SymbolChangedEvents symbolChanges, MarginInterestRates marginInterestRates, DateTime utcTime, bool? hasData=null) | |
Initializes a new instance of the Slice class More... | |
DataDictionary< T > | Get< T > () |
Gets the DataDictionary<T> for all data of the specified type More... | |
dynamic | Get (Type type) |
Gets the data of the specified type. More... | |
T | Get< T > (Symbol symbol) |
Gets the data of the specified symbol and type. More... | |
virtual bool | ContainsKey (Symbol symbol) |
Determines whether this instance contains data for the specified symbol More... | |
override bool | TryGetValue (Symbol symbol, out dynamic data) |
Gets the data associated with the specified symbol More... | |
void | MergeSlice (Slice inputSlice) |
Merge two slice with same Time More... | |
IEnumerator< KeyValuePair< Symbol, BaseData > > | GetEnumerator () |
Returns an enumerator that iterates through the collection. More... | |
Public Member Functions inherited from QuantConnect.ExtendedDictionary< dynamic > | |
virtual void | Clear () |
Removes all items from the T:System.Collections.Generic.ICollection`1. More... | |
abstract bool | TryGetValue (Symbol symbol, out T value) |
Gets the value associated with the specified Symbol. More... | |
virtual bool | Remove (Symbol symbol) |
Removes the value with the specified Symbol More... | |
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... | |
Protected Member Functions | |
Slice (Slice slice) | |
Initializes a new instance used by the PythonSlice More... | |
dynamic | GetImpl (Type type, Slice instance) |
Gets the data of the specified type. More... | |
Protected Attributes | |
override IEnumerable< Symbol > | GetKeys => _data.Value.Keys |
Gets an T:System.Collections.Generic.ICollection`1 containing the Symbol objects of the T:System.Collections.Generic.IDictionary`2. More... | |
override IEnumerable< dynamic > | GetValues => GetKeyValuePairEnumerable().Select(data => (dynamic)data.Value) |
Gets an T:System.Collections.Generic.ICollection`1 containing the values in the T:System.Collections.Generic.IDictionary`2. More... | |
Properties | |
List< BaseData > | AllData [get] |
All the data hold in this slice More... | |
DateTime | Time [get] |
Gets the timestamp for this slice of data More... | |
DateTime | UtcTime [get] |
Gets the timestamp for this slice of data in UTC More... | |
bool | HasData [get] |
Gets whether or not this slice has data More... | |
TradeBars | Bars [get] |
Gets the TradeBars for this slice of data More... | |
QuoteBars | QuoteBars [get] |
Gets the QuoteBars for this slice of data More... | |
Ticks | Ticks [get] |
Gets the Ticks for this slice of data More... | |
OptionChains | OptionChains [get] |
Gets the OptionChains for this slice of data More... | |
FuturesChains | FuturesChains [get] |
Gets the FuturesChains for this slice of data More... | |
FuturesChains | FutureChains [get] |
Gets the FuturesChains for this slice of data More... | |
Splits | Splits [get] |
Gets the Splits for this slice of data More... | |
Dividends | Dividends [get] |
Gets the Dividends for this slice of data More... | |
Delistings | Delistings [get] |
Gets the Delistings for this slice of data More... | |
SymbolChangedEvents | SymbolChangedEvents [get] |
Gets the Market.SymbolChangedEvents for this slice of data More... | |
MarginInterestRates | MarginInterestRates [get] |
Gets the Market.MarginInterestRates for this slice of data More... | |
virtual int | Count [get] |
Gets the number of symbols held in this slice More... | |
virtual IReadOnlyList< Symbol > | Keys [get] |
Gets all the symbols in this slice More... | |
virtual IReadOnlyList< BaseData > | Values [get] |
Gets a list of all the data in this slice More... | |
override dynamic | this[Symbol symbol] [get] |
Gets the data corresponding to the specified symbol. If the requested data is of MarketDataType.Tick, then a List<Tick> will be returned, otherwise, it will be the subscribed type, for example, TradeBar or event UnlinkedData for custom data. More... | |
Properties inherited from QuantConnect.ExtendedDictionary< dynamic > | |
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< dynamic > | |
virtual bool | IsReadOnly |
Gets a value indicating whether the IDictionary object is read-only. More... | |
Provides a data structure for all of an algorithm's data at a single time step
QuantConnect.Data.Slice.Slice | ( | DateTime | time, |
IEnumerable< BaseData > | data, | ||
DateTime | utcTime | ||
) |
Initializes a new instance of the Slice class, lazily instantiating the Slice.Bars and Slice.Ticks collections on demand
time | The timestamp for this slice of data |
data | The raw data in this slice |
utcTime | The timestamp for this slice of data in UTC |
QuantConnect.Data.Slice.Slice | ( | DateTime | time, |
List< BaseData > | data, | ||
DateTime | utcTime | ||
) |
Initializes a new instance of the Slice class, lazily instantiating the Slice.Bars and Slice.Ticks collections on demand
time | The timestamp for this slice of data |
data | The raw data in this slice |
utcTime | The timestamp for this slice of data in UTC |
|
protected |
QuantConnect.Data.Slice.Slice | ( | DateTime | time, |
List< BaseData > | data, | ||
TradeBars | tradeBars, | ||
QuoteBars | quoteBars, | ||
Ticks | ticks, | ||
OptionChains | optionChains, | ||
FuturesChains | futuresChains, | ||
Splits | splits, | ||
Dividends | dividends, | ||
Delistings | delistings, | ||
SymbolChangedEvents | symbolChanges, | ||
MarginInterestRates | marginInterestRates, | ||
DateTime | utcTime, | ||
bool? | hasData = null |
||
) |
Initializes a new instance of the Slice class
time | The timestamp for this slice of data |
data | The raw data in this slice |
tradeBars | The trade bars for this slice |
quoteBars | The quote bars for this slice |
ticks | This ticks for this slice |
optionChains | The option chains for this slice |
futuresChains | The futures chains for this slice |
splits | The splits for this slice |
dividends | The dividends for this slice |
delistings | The delistings for this slice |
symbolChanges | The symbol changed events for this slice |
marginInterestRates | The margin interest rates for this slice |
utcTime | The timestamp for this slice of data in UTC |
hasData | true if this slice contains data |
DataDictionary<T> QuantConnect.Data.Slice.Get< T > | ( | ) |
Gets the DataDictionary<T> for all data of the specified type
T | The type of data we want, for example, TradeBar or UnlinkedData, etc... |
T | : | IBaseData |
Definition at line 343 of file Slice.cs.
dynamic QuantConnect.Data.Slice.Get | ( | Type | type | ) |
|
protected |
T QuantConnect.Data.Slice.Get< T > | ( | Symbol | symbol | ) |
|
virtual |
Determines whether this instance contains data for the specified symbol
symbol | The symbol we seek data for |
Reimplemented in QuantConnect.Python.PythonSlice.
override bool QuantConnect.Data.Slice.TryGetValue | ( | Symbol | symbol, |
out dynamic | data | ||
) |
void QuantConnect.Data.Slice.MergeSlice | ( | Slice | inputSlice | ) |
|
protected |
Gets an T:System.Collections.Generic.ICollection`1 containing the Symbol objects of the T:System.Collections.Generic.IDictionary`2.
|
protected |
Gets an T:System.Collections.Generic.ICollection`1 containing the values in the T:System.Collections.Generic.IDictionary`2.
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
Gets the OptionChains for this slice of data
|
get |
Gets the FuturesChains for this slice of data
|
get |
Gets the FuturesChains for this slice of data
|
get |
|
get |
|
get |
Gets the Delistings for this slice of data
|
get |
Gets the Market.SymbolChangedEvents for this slice of data
|
get |
Gets the Market.MarginInterestRates for this slice of data
|
get |
|
get |
|
get |
|
get |
Gets the data corresponding to the specified symbol. If the requested data is of MarketDataType.Tick, then a List<Tick> will be returned, otherwise, it will be the subscribed type, for example, TradeBar or event UnlinkedData for custom data.
symbol | The data's symbols |