pub struct RiskMetrics {
pub sharpe_ratio: Option<f64>,
pub sortino_ratio: Option<f64>,
pub calmar_ratio: Option<f64>,
pub return_on_max_drawdown: Option<f64>,
pub max_drawdown: f64,
pub max_drawdown_pct: f64,
pub max_drawdown_duration_secs: Option<i64>,
}Expand description
Risk-adjusted return metrics.
Fields§
§sharpe_ratio: Option<f64>Annualized Sharpe ratio. None if fewer than 2 trades.
sortino_ratio: Option<f64>Annualized Sortino ratio (penalizes only downside). None if fewer than 2 trades or no downside.
calmar_ratio: Option<f64>Calmar ratio: annualized_return / max_drawdown_pct. None if max_drawdown is zero or duration < 1 day.
return_on_max_drawdown: Option<f64>total_pnl / max_drawdown. None if max_drawdown is zero.
max_drawdown: f64Largest peak-to-trough drawdown in absolute terms.
max_drawdown_pct: f64Largest peak-to-trough drawdown as percentage of peak.
max_drawdown_duration_secs: Option<i64>Duration of the longest drawdown period (seconds).
Trait Implementations§
Source§impl Clone for RiskMetrics
impl Clone for RiskMetrics
Source§impl Debug for RiskMetrics
impl Debug for RiskMetrics
Source§impl<'de> Deserialize<'de> for RiskMetrics
impl<'de> Deserialize<'de> for RiskMetrics
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RiskMetrics
impl RefUnwindSafe for RiskMetrics
impl Send for RiskMetrics
impl Sync for RiskMetrics
impl Unpin for RiskMetrics
impl UnsafeUnpin for RiskMetrics
impl UnwindSafe for RiskMetrics
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
Mutably borrows from an owned value. Read more