Skip to content

VolatilityModelPythonWrapper

QuantConnect.Python.VolatilityModelPythonWrapper

VolatilityModelPythonWrapper(model: Any)

Bases: BaseVolatilityModel

Provides a volatility model that wraps a PyObject object that represents a model that computes the volatility of a security

Constructor for initialising the VolatilityModelPythonWrapper class with wrapped PyObject object

Parameters:

Name Type Description Default
model Any

Represents a model that computes the volatility of a security

required

volatility

volatility: float

Gets the volatility of the security as a percentage

subscription_data_config_provider

subscription_data_config_provider: (
    ISubscriptionDataConfigProvider
)

Provides access to registered SubscriptionDataConfig

This codeEntityType is protected.

get_history_requirements

get_history_requirements(
    security: Security, utc_time: Union[datetime, date]
) -> Iterable[HistoryRequest]

Returns history requirements for the volatility model expressed in the form of history request

Parameters:

Name Type Description Default
security Security

The security of the request

required
utc_time Union[datetime, date]

The date/time of the request

required

Returns:

Type Description
Iterable[HistoryRequest]

History request object list, or empty if no requirements.

set_subscription_data_config_provider

set_subscription_data_config_provider(
    subscription_data_config_provider: ISubscriptionDataConfigProvider,
) -> None

Sets the ISubscriptionDataConfigProvider instance to use.

Parameters:

Name Type Description Default
subscription_data_config_provider ISubscriptionDataConfigProvider

Provides access to registered SubscriptionDataConfig

required

update

update(security: Security, data: BaseData) -> None

Updates this model using the new price information in the specified security instance

Parameters:

Name Type Description Default
security Security

The security to calculate volatility for

required
data BaseData

The new data used to update the model

required