StandardDeviationOfReturnsVolatilityModel
QuantConnect.Securities.StandardDeviationOfReturnsVolatilityModel
StandardDeviationOfReturnsVolatilityModel(
periods: int,
resolution: Optional[Resolution] = None,
update_frequency: Optional[timedelta] = None,
)
StandardDeviationOfReturnsVolatilityModel(
resolution: Resolution,
update_frequency: Optional[timedelta] = None,
)
Bases: BaseVolatilityModel
Provides an implementation of IVolatilityModel that computes the annualized sample standard deviation of daily returns as the volatility of the security
Initializes a new instance of the StandardDeviationOfReturnsVolatilityModel class
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
periods
|
Optional[int]
|
The max number of samples in the rolling window to be considered for calculating the standard deviation of returns |
None
|
resolution
|
Optional[Resolution] | Resolution
|
Resolution of the price data inserted into the rolling window series to calculate standard deviation. |
None
|
update_frequency
|
Optional[timedelta]
|
Frequency at which we insert new values into the rolling window for the standard deviation calculation |
None
|
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 of the request |
required |
Returns:
| Type | Description |
|---|---|
Iterable[HistoryRequest]
|
History request object list, or empty if no requirements. |
update
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 |