Module yata::methods

source ·
Expand description

Commonly used methods for manipulating timeseries. Every method implements Method trait.

To create a method instance use Method::new. To get new output value over the input value use Method::next.

// creating Weighted Moving Average of length `5`
use yata::prelude::*;
use yata::methods::WMA;

let mut wma = WMA::new(5, &20.0).unwrap();

let input_value = &34.51;
let output_value = wma.next(input_value);

§Examples

use yata::prelude::*;
use yata::methods::SMA;

let mut sma = SMA::new(3, &5.0).unwrap();
sma.next(&5.0);
sma.next(&4.0);
assert_eq!(sma.next(&6.0), 5.0);
assert_eq!(sma.next(&2.0), 4.0);
assert_eq!(sma.next(&-2.0), 2.0);

Modules§

  • Renko implementation entities

Structs§

Type Aliases§