DynamicSecurityData
QuantConnect.Securities.DynamicSecurityData
DynamicSecurityData(
registered_types: IRegisteredSecurityDataTypesProvider,
cache: SecurityCache,
)
Bases: IDynamicMetaObjectProvider
Provides access to a security's data via it's type. This implementation supports dynamic access by type name.
Initializes a new instance of the DynamicSecurityData class
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registered_types
|
IRegisteredSecurityDataTypesProvider
|
Provides all the registered data types for the algorithm |
required |
cache
|
SecurityCache
|
The security cache |
required |
get
get(type: Type) -> Any
Get the matching cached object in a python friendly accessor
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Type
|
Type to search for |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Matching object. |
get_all
get_all(type: Type) -> List[Any]
Get all the matching types with a python friendly overload.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Type
|
Search type |
required |
Returns:
| Type | Description |
|---|---|
List[Any]
|
List of matching objects cached. |
get_meta_object
get_meta_object(parameter: Any) -> Any
Returns the System.Dynamic.DynamicMetaObject responsible for binding operations performed on this object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameter
|
Any
|
The expression tree representation of the runtime value. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The System.Dynamic.DynamicMetaObject to bind this object. |
get_property
get_property(name: str) -> Object
Gets the property's value with the specified name. This is a case-insensitve search.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The property name to access |
required |
Returns:
| Type | Description |
|---|---|
Object
|
object value of BaseData. |
has_property
has_property(name: str) -> bool
Gets whether or not this dynamic data instance has a property with the specified name. This is a case-insensitive search.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The property name to check for |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the property exists, false otherwise. |
set_property
set_property(name: str, value: Any) -> Object
Sets the property with the specified name to the value. This is a case-insensitve search.
DynamicSecurityData is a view of the SecurityCache. It is readonly, properties can not be set
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The property name to set |
required |
value
|
Any
|
The new property value |
required |
Returns:
| Type | Description |
|---|---|
Object
|
Returns the input value back to the caller. |