Skip to main content

Indicator

Trait Indicator 

Source
pub trait Indicator: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn warmup_period(&self) -> usize;
    fn compute(&self, candles: &[Candle]) -> Result<Series, IndicatorError>;
}
Expand description

A technical indicator that computes a continuous numeric time series.

All indicators are pure functions - no I/O, no async, no side effects. This makes them easy to test, compose, and potentially compile to WASM.

For discrete classification outputs (e.g., VolumeAnomaly), use ClassificationIndicator<T> instead.

Required Methods§

Source

fn name(&self) -> &str

The name of this indicator (e.g., “SMA(20)”).

Source

fn warmup_period(&self) -> usize

Minimum number of candles required before output is valid.

Source

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

Compute the indicator values from candle data.

Implementors§