realized_volatilityΒΆ
Defined in fynance.features.indicators
- realized_volatility(X, w=21, period=252, axis=0, dtype=None)[source]
Annualized realized volatility from a price series.
Rolling standard deviation of log-returns, annualized by \(\sqrt{period}\). Causal: returns are strictly past, the window expands over the first observations.
- Parameters:
- Xnp.ndarray[dtype, ndim=1 or 2]
Price/level series.
- wint, optional
Rolling window over returns. Default 21.
- periodint, optional
Annualization factor (e.g. 252 daily). Default 252.
- axis{0, 1}, optional
Axis of computation. Default 0.
- dtypenp.dtype, optional
Output dtype.
- Returns:
- np.ndarray[dtype, ndim=1 or 2]
Annualized realized volatility, aligned to
X(first entry 0).