SliceExtensions
QuantConnect.Data.SliceExtensions
Bases: Object
Provides extension methods to slices and slice enumerables
push_through_consolidators
push_through_consolidators(
slices: List[Slice],
consolidators_by_symbol: Dictionary[
Symbol, IDataConsolidator
],
) -> None
push_through_consolidators(
slices: List[Slice],
consolidators_provider: Callable[
[Symbol], IDataConsolidator
],
) -> None
Loops through the specified slices and pushes the data into the consolidators. This can be used to easily warm up indicators from a history call that returns slice objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slices
|
List[Slice]
|
The data to send into the consolidators, likely result of a history request |
required |
consolidators_by_symbol
|
Optional[Dictionary[Symbol, IDataConsolidator]]
|
Dictionary of consolidators keyed by symbol |
None
|
consolidators_provider
|
Optional[Callable[[Symbol], IDataConsolidator]]
|
Delegate that fetches the consolidators by a symbol |
None
|
get_universe_data
get_universe_data(
slices: List[Slice],
) -> Sequence[DataDictionary[BaseDataCollection]]
Gets the data dictionaries or points of the requested type in each slice
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slices
|
List[Slice]
|
The enumerable of slice |
required |
Returns:
| Type | Description |
|---|---|
Sequence[DataDictionary[BaseDataCollection]]
|
An enumerable of data dictionary or data point of the requested type. |
push_through
push_through(
slices: List[Slice],
handler: Callable[[BaseData], Any],
data_type: Type = None,
) -> None
Loops through the specified slices and pushes the data into the consolidators. This can be used to easily warm up indicators from a history call that returns slice objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slices
|
List[Slice]
|
The data to send into the consolidators, likely result of a history request |
required |
handler
|
Callable[[BaseData], Any]
|
Delegate handles each data piece from the slice |
required |
data_type
|
Type
|
Defines the type of the data that should be pushed |
None
|
ticks
to_double_array
to_double_array(decimals: List[float]) -> List[float]
Converts the specified enumerable of decimals into a double array
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
decimals
|
List[float]
|
The enumerable of decimal |
required |
Returns:
| Type | Description |
|---|---|
List[float]
|
Double array representing the enumerable of decimal. |