cmo-rs

Crates.iocmo-rs
lib.rscmo-rs
version0.1.0
sourcesrc
created_at2020-11-27 14:16:59.244712
updated_at2020-11-27 14:16:59.244712
descriptionChande Momentum Oscillator (CMO) in Rust
homepagehttps://github.com/immortalinfidel/cmo-rs
repositoryhttps://github.com/immortalinfidel/cmo-rs
max_upload_size
id317063
size5,034
sabin chitrakar (sabinchitrakar)

documentation

README

Build Status

Chande Momentum Oscillator (CMO)

 use cmo_rs::CMO;
 use ta_common::traits::Indicator;

let mut cmo = CMO::new(5);
assert_eq!(cmo.next(81.59), None);
assert_eq!(cmo.next(81.06), None);
assert_eq!(cmo.next(82.87), None);
assert_eq!(cmo.next(83.00), None);
assert_eq!(cmo.next(83.61), Some(79.77099236641216));
assert_eq!(cmo.next(83.15), Some(84.4117647058823));
assert_eq!(cmo.next(82.84), Some(100.0));
assert_eq!(cmo.next(83.99), Some(100.0));
assert_eq!(cmo.next(84.55), Some(100.0));
assert_eq!(cmo.next(84.36), Some(100.0));
assert_eq!(cmo.next(85.53), Some(100.0));
assert_eq!(cmo.next(86.54), Some(100.0));
assert_eq!(cmo.next(86.89), Some(100.0));
assert_eq!(cmo.next(87.77), Some(100.0));
assert_eq!(cmo.next(87.29), Some(100.0));
Commit count: 0

cargo fmt