pub enum IndicatorValue {
Single(f64),
Multiple(Vec<f64>),
None,
}Expand description
The output value of an indicator at a single bar position.
An owned row for constructing or exporting IndicatorValues.
Studies store columns; this row format is also accepted by custom calculation closures.
The variant depends on the indicator:
Single(f64)– used by single-line indicators (SMA, EMA, RSI, ATR, …).Multiple(Vec<f64>)– used by multi-line indicators, one value per line in the order ofline_names. For example, MACD emits[macd_line, signal_line, histogram]and Bollinger Bands emits[upper, middle, lower]. A line without a value on the bar, such as a signal line during its warmup, is NaN.None– emitted for bars where no line has a value: within the indicator’s warmup period, or on a bar whose inputs are not finite.
An indicator with more than one line emits Multiple with
line_count values or None, never Single.
Variants§
Single(f64)
A single computed value (e.g. SMA output at one bar).
Multiple(Vec<f64>)
One value per line for multi-line indicators (e.g. MACD producing MACD line, signal line, and histogram), NaN for a line without one.
None
No value on this bar: warmup, or inputs that are not finite.
Trait Implementations§
Source§impl Clone for IndicatorValue
impl Clone for IndicatorValue
Source§fn clone(&self) -> IndicatorValue
fn clone(&self) -> IndicatorValue
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 IndicatorValue
impl Debug for IndicatorValue
Source§impl FromIterator<IndicatorValue> for IndicatorValues
impl FromIterator<IndicatorValue> for IndicatorValues
Source§fn from_iter<T: IntoIterator<Item = IndicatorValue>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = IndicatorValue>>(iter: T) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for IndicatorValue
impl RefUnwindSafe for IndicatorValue
impl Send for IndicatorValue
impl Sync for IndicatorValue
impl Unpin for IndicatorValue
impl UnsafeUnpin for IndicatorValue
impl UnwindSafe for IndicatorValue
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