pub struct MetricsView {
pub total_return: f64,
pub cagr: f64,
pub max_drawdown: f64,
pub volatility: f64,
pub sharpe: Option<f64>,
pub sortino: Option<f64>,
pub calmar: Option<f64>,
pub psr: Option<f64>,
pub trades: u32,
}Fields§
§total_return: f64§cagr: f64§max_drawdown: f64§volatility: f64§sharpe: Option<f64>§sortino: Option<f64>§calmar: Option<f64>§psr: Option<f64>Probability the true Sharpe is above zero, given the sample.
The second number a Sharpe needs. 1.2 from forty returns and 1.2 from four thousand print identically and are not the same finding.
trades: u32Implementations§
Source§impl MetricsView
impl MetricsView
Sourcepub fn sharpe(&self) -> f64
pub fn sharpe(&self) -> f64
Returns the value of sharpe, or the default value if sharpe is unset.
Sourcepub fn sortino(&self) -> f64
pub fn sortino(&self) -> f64
Returns the value of sortino, or the default value if sortino is unset.
Trait Implementations§
Source§impl Clone for MetricsView
impl Clone for MetricsView
impl Copy for MetricsView
Source§impl Debug for MetricsView
impl Debug for MetricsView
Source§impl Default for MetricsView
impl Default for MetricsView
Source§impl<'de> Deserialize<'de> for MetricsView
impl<'de> Deserialize<'de> for MetricsView
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
Source§impl Message for MetricsView
impl Message for MetricsView
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for MetricsView
impl PartialEq for MetricsView
Source§impl Serialize for MetricsView
impl Serialize for MetricsView
impl StructuralPartialEq for MetricsView
Auto Trait Implementations§
impl Freeze for MetricsView
impl RefUnwindSafe for MetricsView
impl Send for MetricsView
impl Sync for MetricsView
impl Unpin for MetricsView
impl UnsafeUnpin for MetricsView
impl UnwindSafe for MetricsView
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