[][src]Struct ta::indicators::StandardDeviation

pub struct StandardDeviation { /* fields omitted */ }

Standard deviation (SD).

Returns the standard deviation of the last n values.

Formula

SD formula

Where:

  • σ - value of standard deviation for N given probes.
  • N - number of probes in observation.
  • xi - i-th observed value from N elements observation.

Parameters

  • n - number of periods (integer greater than 0)

Example

use ta::indicators::StandardDeviation;
use ta::Next;

let mut sd = StandardDeviation::new(3).unwrap();
assert_eq!(sd.next(10.0), 0.0);
assert_eq!(sd.next(20.0), 5.0);

Links

Methods

impl StandardDeviation[src]

pub fn new(n: u32) -> Result<Self>[src]

Trait Implementations

impl Clone for StandardDeviation[src]

impl Debug for StandardDeviation[src]

impl Default for StandardDeviation[src]

impl Display for StandardDeviation[src]

impl<'a, T: Close> Next<&'a T> for StandardDeviation[src]

type Output = f64

impl Next<f64> for StandardDeviation[src]

type Output = f64

impl Reset for StandardDeviation[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.