pub struct TradesView {
pub closed: u32,
pub still_open: u32,
pub win_rate: Option<f64>,
pub profit_factor: Option<f64>,
pub expectancy: Option<f64>,
pub average_win: Option<f64>,
pub average_loss: Option<f64>,
pub average_holding_days: Option<f64>,
pub fees_paid: f64,
pub fees_fraction: f64,
pub signal_exits: u32,
pub stop_exits: u32,
}Expand description
Every shape at the root as well, because a window names a view on nearly
every line and arvo_api::research::StudyView would be noise. The names
do not collide: proto has no overloading and neither does this.
Every shape at the root as well, because a window names a view on nearly
every line and arvo_api::research::StudyView would be noise. The names
do not collide: proto has no overloading and neither does this.
Every shape at the root as well, because a window names a view on nearly
every line and arvo_api::research::StudyView would be noise. The names
do not collide: proto has no overloading and neither does this.
What the round trips looked like, flattened for display.
Beside the metrics rather than inside them: metrics come from the equity curve and these come from the ledger, and keeping the two apart is what makes it obvious which is which when they say different things.
Fields§
§closed: u32§still_open: u32§win_rate: Option<f64>§profit_factor: Option<f64>§expectancy: Option<f64>§average_win: Option<f64>§average_loss: Option<f64>§average_holding_days: Option<f64>Mean holding period in days, which is the unit a reader thinks in and the one that decides short- versus long-term tax treatment.
fees_paid: f64Every fee and commission the venue charged, in account currency.
Fees only — slippage is charged inside the fill prices and is already
reflected in the return, not here. Naming this fees rather than
cost is the whole point: a reader who took it for the total cost of
trading would be short by the spread assumption on every round trip.
fees_fraction: f64Fees as a fraction of starting capital, so they can be read against the return directly.
signal_exits: u32§stop_exits: u32Implementations§
Source§impl TradesView
impl TradesView
Sourcepub fn win_rate(&self) -> f64
pub fn win_rate(&self) -> f64
Returns the value of win_rate, or the default value if win_rate is unset.
Sourcepub fn profit_factor(&self) -> f64
pub fn profit_factor(&self) -> f64
Returns the value of profit_factor, or the default value if profit_factor is unset.
Sourcepub fn expectancy(&self) -> f64
pub fn expectancy(&self) -> f64
Returns the value of expectancy, or the default value if expectancy is unset.
Sourcepub fn average_win(&self) -> f64
pub fn average_win(&self) -> f64
Returns the value of average_win, or the default value if average_win is unset.
Sourcepub fn average_loss(&self) -> f64
pub fn average_loss(&self) -> f64
Returns the value of average_loss, or the default value if average_loss is unset.
Sourcepub fn average_holding_days(&self) -> f64
pub fn average_holding_days(&self) -> f64
Returns the value of average_holding_days, or the default value if average_holding_days is unset.
Trait Implementations§
Source§impl Clone for TradesView
impl Clone for TradesView
impl Copy for TradesView
Source§impl Debug for TradesView
impl Debug for TradesView
Source§impl Default for TradesView
impl Default for TradesView
Source§impl<'de> Deserialize<'de> for TradesView
impl<'de> Deserialize<'de> for TradesView
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>,
Source§impl Message for TradesView
impl Message for TradesView
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
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,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
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,
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,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
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,
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,
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,
self.