Crates.io | roc-rs |
lib.rs | roc-rs |
version | 0.1.0 |
source | src |
created_at | 2020-11-16 07:29:20.04025 |
updated_at | 2020-11-16 07:29:20.04025 |
description | Rate Of Change (ROC) Implementation In Rust |
homepage | https://github.com/immortalinfidel/roc-rs |
repository | https://github.com/immortalinfidel/roc-rs.git |
max_upload_size | |
id | 312808 |
size | 4,530 |
Rate Of Change (ROC) implementation in rust
use roc_rs::ROC;
use ta_common::traits::Indicator;
let mut roc = ROC::new(1, None);
let res = roc.next(100 as f64);
assert_eq!(None, res);
let res = roc.next(50 as f64);
assert_eq!(Some(-50_f32), res);
ROCR=(Current Price/Price Prev n Ago);
ROCP=ROCR-1;
ROC100=(ROCR)*100;
ROC=(ROCR-1)*100; //DEFAULT