#[non_exhaustive]pub struct RiskSummary {
pub var_95: f64,
pub var_99: f64,
pub parametric_var_95: 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>,
}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)
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.
Trait Implementations§
Source§impl Clone for RiskSummary
impl Clone for RiskSummary
Source§fn clone(&self) -> RiskSummary
fn clone(&self) -> RiskSummary
1.0.0 · 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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