pub struct RollingMetrics {
pub window_size: Positive,
pub timestamps: Vec<NaiveDateTime>,
pub rolling_returns: Vec<Decimal>,
pub rolling_volatility: Vec<Decimal>,
pub rolling_sharpe: Vec<Decimal>,
pub rolling_sortino: Vec<Decimal>,
pub rolling_win_rate: Vec<Decimal>,
}Expand description
Represents rolling window metrics calculated over a specific period.
This struct holds various performance metrics calculated using a sliding window approach, allowing for the analysis of how a strategy’s performance characteristics change over time.
Fields§
§window_size: PositiveThe size of the rolling window used for calculations. This indicates the number of data points included in each rolling calculation. It must be a positive value.
timestamps: Vec<NaiveDateTime>A vector of timestamps corresponding to the end of each rolling window period.
rolling_returns: Vec<Decimal>A vector of rolling returns calculated for each window.
rolling_volatility: Vec<Decimal>A vector of rolling volatility (standard deviation of returns) calculated for each window.
rolling_sharpe: Vec<Decimal>A vector of rolling Sharpe ratios calculated for each window. The Sharpe ratio measures risk-adjusted return, typically using volatility as the risk measure.
rolling_sortino: Vec<Decimal>A vector of rolling Sortino ratios calculated for each window. The Sortino ratio is similar to the Sharpe ratio but only considers downside volatility.
rolling_win_rate: Vec<Decimal>A vector of rolling win rates calculated for each window. The win rate represents the percentage of winning trades or periods within the window.
Trait Implementations§
Source§impl Clone for RollingMetrics
impl Clone for RollingMetrics
Source§impl Debug for RollingMetrics
impl Debug for RollingMetrics
Source§impl Default for RollingMetrics
impl Default for RollingMetrics
Source§impl<'de> Deserialize<'de> for RollingMetrics
impl<'de> Deserialize<'de> for RollingMetrics
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 RollingMetrics
impl RefUnwindSafe for RollingMetrics
impl Send for RollingMetrics
impl Sync for RollingMetrics
impl Unpin for RollingMetrics
impl UnsafeUnpin for RollingMetrics
impl UnwindSafe for RollingMetrics
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.