#[non_exhaustive]pub struct Member {
pub change: f64,
pub volume: f64,
pub new_high: bool,
pub new_low: bool,
pub above_ma: bool,
pub on_buy_signal: bool,
}Expand description
One symbol’s contribution to a CrossSection tick.
Field invariants enforced by CrossSection::new when the member is placed
into a tick:
changeis finite (its sign classifies the symbol — positive is advancing, negative is declining, zero is unchanged).volumeis finite and non-negative.
new_high / new_low are caller-supplied flags marking whether the symbol
printed a new period extreme; above_ma / on_buy_signal are caller-supplied
per-symbol state signals (whether the symbol trades above its reference moving
average, and whether it is on a point-and-figure buy signal). None of the four
flags carries a numeric invariant.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.change: f64Price change versus the previous close. Sign classifies the symbol: positive is advancing, negative is declining, zero is unchanged.
volume: f64Period volume for the symbol (finite, non-negative).
new_high: boolWhether the symbol printed a new period high.
new_low: boolWhether the symbol printed a new period low.
above_ma: boolWhether the symbol is trading above its reference moving average
(consumed by the % Above Moving Average breadth indicator).
on_buy_signal: boolWhether the symbol is on a point-and-figure buy signal
(consumed by the Bullish Percent Index breadth indicator).
Implementations§
Source§impl Member
impl Member
Sourcepub const fn new(
change: f64,
volume: f64,
new_high: bool,
new_low: bool,
) -> Self
pub const fn new( change: f64, volume: f64, new_high: bool, new_low: bool, ) -> Self
Assemble a cross-section member from its core signals, leaving the
extended per-symbol state flags (above_ma, on_buy_signal) cleared.
The field invariants documented on Member are validated centrally by
CrossSection::new when the member is placed into a tick; this
constructor only assembles the value so the #[non_exhaustive] struct can
be built from outside the crate.
Sourcepub const fn with_signals(
change: f64,
volume: f64,
new_high: bool,
new_low: bool,
above_ma: bool,
on_buy_signal: bool,
) -> Self
pub const fn with_signals( change: f64, volume: f64, new_high: bool, new_low: bool, above_ma: bool, on_buy_signal: bool, ) -> Self
Assemble a cross-section member including the extended per-symbol state
signals above_ma and on_buy_signal.
Use this constructor for the breadth indicators that read per-symbol
state (% Above Moving Average, Bullish Percent Index); new
is the shorthand that leaves both flags false.
Trait Implementations§
impl Copy for Member
impl StructuralPartialEq for Member
Auto Trait Implementations§
impl Freeze for Member
impl RefUnwindSafe for Member
impl Send for Member
impl Sync for Member
impl Unpin for Member
impl UnsafeUnpin for Member
impl UnwindSafe for Member
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> 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 more