Trait splr::types::EmaIF[][src]

pub trait EmaIF {
    type Input;
    fn get(&self) -> f64;
fn update(&mut self, x: Self::Input); fn reset(&mut self) { ... }
fn trend(&self) -> f64 { ... } }

API for Exponential Moving Average, EMA, like get, reset, update and so on.

Associated Types

type Input[src]

the type of the argument of update.

Loading content...

Required methods

fn get(&self) -> f64[src]

return the current value.

fn update(&mut self, x: Self::Input)[src]

catch up with the current state.

Loading content...

Provided methods

fn reset(&mut self)[src]

reset internal data.

fn trend(&self) -> f64[src]

return a ratio of short / long statistics.

Loading content...

Implementors

impl EmaIF for Ema2[src]

type Input = f64

impl EmaIF for Ema[src]

type Input = f64

impl EmaIF for EmaSU[src]

type Input = usize

Loading content...