[][src]Struct roc_rs::ROC

pub struct ROC { /* fields omitted */ }


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);


impl ROC[src]

pub fn new(price_ago: u32, result_type: Option<ROCType>) -> ROC[src]

pub fn calc(&self, input: f64) -> Option<f32>[src]

Trait Implementations

impl Indicator<f64, Option<f32>> for ROC[src]

Auto Trait Implementations

impl RefUnwindSafe for ROC

impl Send for ROC

impl Sync for ROC

impl Unpin for ROC

impl UnwindSafe for ROC

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.