pub struct IndicatorOutput { /* private fields */ }Expand description
Named column output, analogous to pd.DataFrame returned by Python calculate().
Keys are column names such as "SMA_20", "MACD_line", "ATR_14".
Values are aligned Vec<f64> of the same length as the input slice.
Leading warm-up entries are f64::NAN.
Implementations§
Source§impl IndicatorOutput
impl IndicatorOutput
Sourcepub fn from_pairs<K: Into<String>>(
pairs: impl IntoIterator<Item = (K, Vec<f64>)>,
) -> Self
pub fn from_pairs<K: Into<String>>( pairs: impl IntoIterator<Item = (K, Vec<f64>)>, ) -> Self
Build from an iterator of (name, values) pairs.
Sourcepub fn latest(&self, name: &str) -> Option<f64>
pub fn latest(&self, name: &str) -> Option<f64>
Get the last (most recent) value of a named column, skipping NaN.
Mirrors Python’s indicator.get_value(-1).
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of rows (length of any column; all columns are guaranteed equal length).
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for IndicatorOutput
impl Clone for IndicatorOutput
Source§fn clone(&self) -> IndicatorOutput
fn clone(&self) -> IndicatorOutput
Returns a duplicate of the value. Read more
1.0.0 · 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 IndicatorOutput
impl Debug for IndicatorOutput
Source§impl Default for IndicatorOutput
impl Default for IndicatorOutput
Source§fn default() -> IndicatorOutput
fn default() -> IndicatorOutput
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IndicatorOutput
impl RefUnwindSafe for IndicatorOutput
impl Send for IndicatorOutput
impl Sync for IndicatorOutput
impl Unpin for IndicatorOutput
impl UnsafeUnpin for IndicatorOutput
impl UnwindSafe for IndicatorOutput
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