[][src]Struct sd_rs::SD

pub struct SD { /* fields omitted */ }

Standard Deviation (SD)

use ta_common::traits::Indicator;
use sd_rs::SD;
let mut sd = SD::new(5);
assert_eq!(sd.next(81.59), None);
assert_eq!(sd.next(81.06), None);
assert_eq!(sd.next(82.87), None);
assert_eq!(sd.next(83.00), None);
assert_eq!(sd.next(83.61), Some(0.9479789027188307));
assert_eq!(sd.next(83.15), Some(0.8754290376723858));
assert_eq!(sd.next(82.84), Some(0.28032837887020867));
assert_eq!(sd.next(83.99), Some(0.42300827415075176));
assert_eq!(sd.next(84.55), Some(0.6051247805205106));
assert_eq!(sd.next(84.36), Some(0.67139854036183));
assert_eq!(sd.next(85.53), Some(0.8713346085173014));
assert_eq!(sd.next(86.54), Some(0.9256910931839016));
assert_eq!(sd.next(86.89), Some(1.0187561042761923));
assert_eq!(sd.next(87.77), Some(1.1738381489796619));
assert_eq!(sd.next(87.29), Some(0.7575645187045117));


impl SD[src]

pub fn new(period: u32) -> SD[src]

pub fn get_current_sma(&self) -> f64[src]

Trait Implementations

impl Indicator<f64, Option<f64>> for SD[src]

Auto Trait Implementations

impl RefUnwindSafe for SD

impl Send for SD

impl Sync for SD

impl Unpin for SD

impl UnwindSafe for SD

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.