Skip to content

DataDictionary

QuantConnect.Data.Market.DataDictionary

DataDictionary()
DataDictionary(
    data: List[QuantConnect_Data_Market_DataDictionary_T],
    key_selector: Callable[
        [QuantConnect_Data_Market_DataDictionary_T], Symbol
    ],
)
DataDictionary(time: Union[datetime, date])

Bases: Generic[QuantConnect_Data_Market_DataDictionary_T], BaseExtendedDictionary[Symbol, QuantConnect_Data_Market_DataDictionary_T]

Provides a base class for types holding base data instances keyed by symbol

Signature descriptions:

  • Initializes a new instance of the QuantConnect.Data.Market.DataDictionary{T} class.

  • Initializes a new instance of the QuantConnect.Data.Market.DataDictionary{T} class using the specified data as a data source

Parameters:

Name Type Description Default
data Optional[List[QuantConnect_Data_Market_DataDictionary_T]]

The data source for this data dictionary

None
key_selector Optional[Callable[[QuantConnect_Data_Market_DataDictionary_T], Symbol]]

Delegate used to select a key from the value

None
time Optional[Union[datetime, date]]

The time this data was emitted.

None

time

time: datetime

Gets or sets the time associated with this collection of data

__getitem__

__getitem__(
    symbol: Union[Symbol, str, BaseContract],
) -> QuantConnect_Data_Market_DataDictionary_T

Gets or sets the element with the specified key.

__setitem__

__setitem__(
    symbol: Union[Symbol, str, BaseContract],
    value: QuantConnect_Data_Market_DataDictionary_T,
) -> None

Gets or sets the element with the specified key.

get_value

get_value(
    key: Union[Symbol, str, BaseContract],
) -> QuantConnect_Data_Market_DataDictionary_T

Gets the value associated with the specified key.