1 个不稳定版本
0.1.0 | 2020年11月27日 |
---|
#14 in #oscillator
5KB
76 代码行数(不含注释)
Chande 动量振荡器 (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));
依赖
~14KB