pub struct MarketConditionMetrics {
pub bull_market_days: Positive,
pub bear_market_days: Positive,
pub sideways_market_days: Positive,
pub high_volatility_days: Positive,
pub low_volatility_days: Positive,
pub avg_market_volatility: Option<Decimal>,
}
Expand description
Represents metrics related to market conditions observed during a specific period, typically a backtest.
This struct captures counts of days categorized by different market trends (bull, bear, sideways)
and volatility levels (high, low). It also stores the average market volatility over the period.
The counts are represented using the Positive
type, ensuring they are non-negative decimal values.
Fields§
§bull_market_days: Positive
The number of days identified as being in a bull market trend.
bear_market_days: Positive
The number of days identified as being in a bear market trend.
sideways_market_days: Positive
The number of days identified as being in a sideways or range-bound market trend.
high_volatility_days: Positive
The number of days identified as having high market volatility.
low_volatility_days: Positive
The number of days identified as having low market volatility.
avg_market_volatility: Option<Decimal>
The calculated average market volatility over the period. This might be None
if volatility couldn’t be calculated.
Trait Implementations§
Source§impl Clone for MarketConditionMetrics
impl Clone for MarketConditionMetrics
Source§fn clone(&self) -> MarketConditionMetrics
fn clone(&self) -> MarketConditionMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MarketConditionMetrics
impl Debug for MarketConditionMetrics
Source§impl Default for MarketConditionMetrics
impl Default for MarketConditionMetrics
Source§fn default() -> MarketConditionMetrics
fn default() -> MarketConditionMetrics
Source§impl<'de> Deserialize<'de> for MarketConditionMetrics
impl<'de> Deserialize<'de> for MarketConditionMetrics
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 MarketConditionMetrics
impl RefUnwindSafe for MarketConditionMetrics
impl Send for MarketConditionMetrics
impl Sync for MarketConditionMetrics
impl Unpin for MarketConditionMetrics
impl UnwindSafe for MarketConditionMetrics
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,
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.