sd-rs

Crates.iosd-rs
lib.rssd-rs
version0.1.0
sourcesrc
created_at2020-11-24 04:42:11.175079
updated_at2020-11-24 04:42:11.175079
descriptionStandard Deviation Over Period (SD) implementation in Rust
homepagehttps://github.com/immortalinfidel/sd-rs
repositoryhttps://github.com/immortalinfidel/sd-rs
max_upload_size
id315645
size4,646
sabin chitrakar (sabinchitrakar)

documentation

README

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));
Commit count: 3

cargo fmt