pub struct IndicatorOutput {
pub value: f64,
pub secondary: Option<f64>,
pub signal: Option<f64>,
pub extra: HashMap<String, f64>,
pub state: Option<String>,
pub reason: Option<String>,
pub artifacts: Vec<Artifact>,
pub series_capabilities: Option<SeriesCapabilities>,
}Expand description
Output struct returned by an indicator on each processed Bar.
Fields§
§value: f64§secondary: Option<f64>§signal: Option<f64>§extra: HashMap<String, f64>§state: Option<String>Machine-readable state label (e.g. “trending”, “range”, “spring”), replacing indicator-
local string keys stuffed into extra.
reason: Option<String>Human-readable explanation for the current state/value.
artifacts: Vec<Artifact>Typed result artifacts (pivots, zones, profiles, scenario progress) emitted this bar.
series_capabilities: Option<SeriesCapabilities>Which series this output was computed on, if the caller attached one via
IndicatorOutput::with_capabilities. None by default: a result is only meaningful for
the series it was computed on (session cut, roll/adjustment, provenance).
crate::runner::run_batch_with_applicability sets this automatically from
the SeriesCapabilities it already receives; plain crate::runner::run_batch and direct
Indicator::on_bar calls leave it None since neither has a capabilities value to
attach. This is the same field/pattern already used on elliott::ImpulseValidation/
CorrectionValidation and swing_structure::SwingStructureOutput, generalized here so it
covers every indicator behind the shared Indicator/IndicatorOutput trait (including
pivots_structure/zigzag/zigzag_advanced/pivot_sets) instead of just those three
hand-picked result types.
Implementations§
Source§impl IndicatorOutput
impl IndicatorOutput
pub fn new(value: f64) -> Self
pub fn with_secondary(self, secondary: f64) -> Self
pub fn with_signal(self, signal: f64) -> Self
pub fn with_extra(value: f64, extra: HashMap<String, f64>) -> Self
pub fn with_state(self, state: impl Into<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_artifact(self, artifact: impl Into<Artifact>) -> Self
Sourcepub fn with_capabilities(self, capabilities: SeriesCapabilities) -> Self
pub fn with_capabilities(self, capabilities: SeriesCapabilities) -> Self
Tags this output with the series it was computed on. See
IndicatorOutput::series_capabilities for why this matters.
Trait Implementations§
Source§impl Clone for IndicatorOutput
impl Clone for IndicatorOutput
Source§fn clone(&self) -> IndicatorOutput
fn clone(&self) -> IndicatorOutput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more