#[non_exhaustive]pub struct RiskSummary {Show 17 fields
pub var_95: f64,
pub var_99: f64,
pub parametric_var_95: f64,
pub cvar_95: f64,
pub cvar_99: f64,
pub parametric_cvar_95: f64,
pub omega: f64,
pub kelly: f64,
pub sharpe: Option<f64>,
pub sortino: Option<f64>,
pub calmar: Option<f64>,
pub beta: Option<f64>,
pub max_drawdown: f64,
pub max_drawdown_recovery_periods: Option<u64>,
pub ulcer_index: f64,
pub information_ratio: Option<f64>,
pub tracking_error: Option<f64>,
}Expand description
Comprehensive risk summary for a symbol.
Obtain via Ticker::risk.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.var_95: f641-day historical Value at Risk at 95% confidence (expressed as positive loss fraction)
var_99: f641-day historical Value at Risk at 99% confidence
parametric_var_95: f641-day parametric VaR at 95% confidence (assumes normally distributed returns)
cvar_95: f641-day historical Conditional VaR (Expected Shortfall) at 95% confidence — the average loss in the worst 5% of historical periods.
cvar_99: f641-day historical Conditional VaR at 99% confidence.
parametric_cvar_95: f641-day parametric Conditional VaR at 95% confidence (assumes normally distributed returns).
omega: f64Omega Ratio at a 0.0 threshold: probability-weighted ratio of gains to
losses over the full return distribution. f64::MAX when there are no
negative-return periods.
kelly: f64Kelly Criterion: optimal fraction of capital to risk, treating each
positive-return period as a “win” and each negative-return period as a
“loss”. f64::MAX when there are no losing periods and wins are
positive (unbounded edge).
sharpe: Option<f64>Annualised Sharpe Ratio (risk-free rate = 0, 252 trading days/year).
None when fewer than 2 periods or zero volatility.
sortino: Option<f64>Annualised Sortino Ratio (penalises only downside volatility).
None when fewer than 2 periods or zero downside deviation.
calmar: Option<f64>Calmar Ratio (annualised return / max drawdown).
None when max drawdown is zero.
beta: Option<f64>Beta vs benchmark. None when no benchmark is provided or data is insufficient.
max_drawdown: f64Maximum drawdown as a positive fraction (e.g., 0.30 = 30%)
max_drawdown_recovery_periods: Option<u64>Number of trading periods to recover from the maximum drawdown.
None when no recovery occurred within the data window.
ulcer_index: f64Ulcer Index: root-mean-square of drawdown depth across all periods,
expressed as a percentage (0–100). Penalises both depth and duration of
drawdowns, unlike max_drawdown which only reports the worst single one.
information_ratio: Option<f64>Information Ratio vs benchmark: annualised mean excess return divided by
tracking error. None when no benchmark is provided or data is insufficient.
tracking_error: Option<f64>Tracking error vs benchmark: annualised standard deviation of
(asset − benchmark) periodic returns. None when no benchmark is
provided or data is insufficient.
Trait Implementations§
Source§impl Clone for RiskSummary
impl Clone for RiskSummary
Source§fn clone(&self) -> RiskSummary
fn clone(&self) -> RiskSummary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RiskSummary
impl Debug for RiskSummary
Source§impl<'de> Deserialize<'de> for RiskSummary
impl<'de> Deserialize<'de> for RiskSummary
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for RiskSummary
impl RefUnwindSafe for RiskSummary
impl Send for RiskSummary
impl Sync for RiskSummary
impl Unpin for RiskSummary
impl UnsafeUnpin for RiskSummary
impl UnwindSafe for RiskSummary
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more