Skip to main content

ClassificationIndicator

Trait ClassificationIndicator 

Source
pub trait ClassificationIndicator<T>: Send + Sync {
    // Required methods
    fn lookback(&self) -> usize;
    fn compute(
        &self,
        candles: &[Candle],
    ) -> Result<Vec<Option<T>>, IndicatorError>;
}
Expand description

A classification indicator that maps each candle to a typed domain outcome.

Unlike Indicator (which produces a continuous Decimal series), ClassificationIndicator<T> produces rich domain types (enums, structs).

Returns None for candles within the warmup window, and Some(T) once sufficient history is available.

Required Methods§

Source

fn lookback(&self) -> usize

Number of prior candles consumed before first Some result is emitted.

Source

fn compute(&self, candles: &[Candle]) -> Result<Vec<Option<T>>, IndicatorError>

Classify each candle. Returns one Option<T> per input candle.

Implementors§