Lean
$LEAN_TAG$
|
Provides an implementation of IVolatilityModel that computes the annualized sample standard deviation of daily returns as the volatility of the security More...
Public Member Functions | |
StandardDeviationOfReturnsVolatilityModel (int periods, Resolution? resolution=null, TimeSpan? updateFrequency=null) | |
Initializes a new instance of the StandardDeviationOfReturnsVolatilityModel class More... | |
StandardDeviationOfReturnsVolatilityModel (Resolution resolution, TimeSpan? updateFrequency=null) | |
Initializes a new instance of the StandardDeviationOfReturnsVolatilityModel class More... | |
override void | Update (Security security, BaseData data) |
Updates this model using the new price information in the specified security instance More... | |
override IEnumerable< HistoryRequest > | GetHistoryRequirements (Security security, DateTime utcTime) |
Returns history requirements for the volatility model expressed in the form of history request More... | |
Public Member Functions inherited from QuantConnect.Securities.Volatility.BaseVolatilityModel | |
virtual void | SetSubscriptionDataConfigProvider (ISubscriptionDataConfigProvider subscriptionDataConfigProvider) |
Sets the ISubscriptionDataConfigProvider instance to use. More... | |
IEnumerable< HistoryRequest > | GetHistoryRequirements (Security security, DateTime utcTime, Resolution? resolution, int barCount) |
Gets history requests required for warming up the greeks with the provided resolution More... | |
Properties | |
override decimal | Volatility [get] |
Gets the volatility of the security as a percentage More... | |
Properties inherited from QuantConnect.Securities.Volatility.BaseVolatilityModel | |
ISubscriptionDataConfigProvider | SubscriptionDataConfigProvider [get, set] |
Provides access to registered SubscriptionDataConfig More... | |
virtual decimal | Volatility [get] |
Gets the volatility of the security as a percentage More... | |
Properties inherited from QuantConnect.Securities.IVolatilityModel | |
decimal | Volatility [get] |
Gets the volatility of the security as a percentage More... | |
Provides an implementation of IVolatilityModel that computes the annualized sample standard deviation of daily returns as the volatility of the security
Definition at line 31 of file StandardDeviationOfReturnsVolatilityModel.cs.
QuantConnect.Securities.StandardDeviationOfReturnsVolatilityModel.StandardDeviationOfReturnsVolatilityModel | ( | int | periods, |
Resolution? | resolution = null , |
||
TimeSpan? | updateFrequency = null |
||
) |
Initializes a new instance of the StandardDeviationOfReturnsVolatilityModel class
periods | The max number of samples in the rolling window to be considered for calculating the standard deviation of returns |
resolution | Resolution of the price data inserted into the rolling window series to calculate standard deviation. Will be used as the default value for update frequency if a value is not provided for updateFrequency . This only has a material effect in live mode. For backtesting, this value does not cause any behavioral changes. |
updateFrequency | Frequency at which we insert new values into the rolling window for the standard deviation calculation |
The volatility model will be updated with the most granular/highest resolution data that was added to your algorithm. That means that if I added Resolution.Tick data for my Futures strategy, that this model will be updated using Resolution.Tick data as the algorithm progresses in time.
Keep this in mind when setting the period and update frequency. The Resolution parameter is only used for live mode, or for the default value of the updateFrequency if no value is provided.
Definition at line 86 of file StandardDeviationOfReturnsVolatilityModel.cs.
QuantConnect.Securities.StandardDeviationOfReturnsVolatilityModel.StandardDeviationOfReturnsVolatilityModel | ( | Resolution | resolution, |
TimeSpan? | updateFrequency = null |
||
) |
Initializes a new instance of the StandardDeviationOfReturnsVolatilityModel class
resolution | Resolution of the price data inserted into the rolling window series to calculate standard deviation. Will be used as the default value for update frequency if a value is not provided for updateFrequency . This only has a material effect in live mode. For backtesting, this value does not cause any behavioral changes. |
updateFrequency | Frequency at which we insert new values into the rolling window for the standard deviation calculation |
The volatility model will be updated with the most granular/highest resolution data that was added to your algorithm. That means that if I added Resolution.Tick data for my Futures strategy, that this model will be updated using Resolution.Tick data as the algorithm progresses in time.
Keep this in mind when setting the period and update frequency. The Resolution parameter is only used for live mode, or for the default value of the updateFrequency if no value is provided.
Definition at line 119 of file StandardDeviationOfReturnsVolatilityModel.cs.
|
virtual |
Updates this model using the new price information in the specified security instance
security | The security to calculate volatility for |
data | Data to update the volatility model with |
Reimplemented from QuantConnect.Securities.Volatility.BaseVolatilityModel.
Definition at line 132 of file StandardDeviationOfReturnsVolatilityModel.cs.
|
virtual |
Returns history requirements for the volatility model expressed in the form of history request
security | The security of the request |
utcTime | The date of the request |
Reimplemented from QuantConnect.Securities.Volatility.BaseVolatilityModel.
Definition at line 157 of file StandardDeviationOfReturnsVolatilityModel.cs.
|
get |
Gets the volatility of the security as a percentage
Definition at line 46 of file StandardDeviationOfReturnsVolatilityModel.cs.