Struct ta::indicators::StandardDeviation [−][src]
pub struct StandardDeviation { /* fields omitted */ }
Expand description
Standard deviation (SD).
Returns the standard deviation of the last n values.
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
- period - 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
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for StandardDeviation
impl Send for StandardDeviation
impl Sync for StandardDeviation
impl Unpin for StandardDeviation
impl UnwindSafe for StandardDeviation
Blanket Implementations
Mutably borrows from an owned value. Read more