Struct ta::indicators::SlowStochastic [−][src]
pub struct SlowStochastic { /* fields omitted */ }
Expand description
Slow stochastic oscillator.
Basically it is a fast stochastic oscillator smoothed with exponential moving average.
Parameters
- stochastic_period - number of periods for fast stochastic (integer greater than 0). Default is 14.
- ema_period - period for EMA (integer greater than 0). Default is 3.
Example
use ta::indicators::SlowStochastic; use ta::Next; let mut stoch = SlowStochastic::new(3, 2).unwrap(); assert_eq!(stoch.next(10.0), 50.0); assert_eq!(stoch.next(50.0).round(), 83.0); assert_eq!(stoch.next(50.0).round(), 94.0); assert_eq!(stoch.next(30.0).round(), 31.0); assert_eq!(stoch.next(55.0).round(), 77.0);
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SlowStochastic
impl Send for SlowStochastic
impl Sync for SlowStochastic
impl Unpin for SlowStochastic
impl UnwindSafe for SlowStochastic
Blanket Implementations
Mutably borrows from an owned value. Read more