#[non_exhaustive]pub struct StrategyComparison {
pub buy_and_hold_return: Option<f64>,
pub buy_and_hold_equity: Vec<(DateTime<Utc>, f64)>,
pub excursions: Vec<Option<StrategyExcursion>>,
pub skipped_bars: usize,
}Expand description
Source-bar comparison of a run, from StrategyReport::comparison.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.buy_and_hold_return: Option<f64>Fee-free fractional return: last close / first open - 1. Requires a positive first open.
buy_and_hold_equity: Vec<(DateTime<Utc>, f64)>Initial capital invested at the first open, marked at each bar close. Times are the source bar timestamps, as in a chart. Empty without positive finite capital or a defined return.
excursions: Vec<Option<StrategyExcursion>>One result per input trade, in input order. None for an invalid trade, absent source bars,
or an invalid bar during the trade. See StrategyExcursion for the bar-resolution limits.
skipped_bars: usizeInvalid OHLC bars, or all bars when timestamps are not strictly increasing.
Trait Implementations§
Source§impl Clone for StrategyComparison
impl Clone for StrategyComparison
Source§fn clone(&self) -> StrategyComparison
fn clone(&self) -> StrategyComparison
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StrategyComparison
impl Debug for StrategyComparison
Source§impl Default for StrategyComparison
impl Default for StrategyComparison
Source§fn default() -> StrategyComparison
fn default() -> StrategyComparison
Returns the “default value” for a type. Read more
Source§impl PartialEq for StrategyComparison
impl PartialEq for StrategyComparison
impl StructuralPartialEq for StrategyComparison
Auto Trait Implementations§
impl Freeze for StrategyComparison
impl RefUnwindSafe for StrategyComparison
impl Send for StrategyComparison
impl Sync for StrategyComparison
impl Unpin for StrategyComparison
impl UnsafeUnpin for StrategyComparison
impl UnwindSafe for StrategyComparison
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
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,
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> ⓘ
Converts
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> ⓘ
Converts
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