Skip to content

ParameterAttribute

QuantConnect.Parameters.ParameterAttribute

ParameterAttribute(name: str = None)

Bases: Attribute

Specifies a field or property is a parameter that can be set from an AlgorithmNodePacket.Parameters dictionary

Initializes a new instance of the ParameterAttribute class

Parameters:

Name Type Description Default
name str

The name of the parameter. If null is specified then the field or property name will be used

None

BINDING_FLAGS

BINDING_FLAGS: BindingFlags = ...

Specifies the binding flags used by this implementation to resolve parameter attributes

name

name: str

Gets the name of this parameter

apply_attributes

apply_attributes(
    parameters: Dictionary[str, str], instance: Any
) -> None

Uses reflections to inspect the instance for any parameter attributes. If a value is found in the parameters dictionary, it is set.

Parameters:

Name Type Description Default
parameters Dictionary[str, str]

The parameters dictionary

required
instance Any

The instance to set parameters on

required

get_parameters_from_assembly

get_parameters_from_assembly(
    assembly: Assembly,
) -> Dictionary[str, str]

Resolves all parameter attributes from the specified compiled assembly path

Parameters:

Name Type Description Default
assembly Assembly

The assembly to inspect

required

Returns:

Type Description
Dictionary[str, str]

Parameters dictionary keyed by parameter name with a value of the member type.

get_parameters_from_type

get_parameters_from_type(
    type: Type,
) -> Iterable[KeyValuePair[str, str]]

Resolves all parameter attributes from the specified type

Parameters:

Name Type Description Default
type Type

The type to inspect

required

Returns:

Type Description
Iterable[KeyValuePair[str, str]]

Parameters dictionary keyed by parameter name with a value of the member type.