[][src]Struct ppo_rs::PPO

pub struct PPO { /* fields omitted */ }

Percentage Price Oscillator (PPO)

use ppo_rs::PPO;
use ta_common::traits::Indicator;

let mut ppo = PPO::new(2, 5);
assert_eq!(ppo.next(81.59), None);
assert_eq!(ppo.next(81.06), Some(-0.21699967245331922));
assert_eq!(ppo.next(82.87), Some(0.5209675887612042));
assert_eq!(ppo.next(83.00), Some(0.6190403299147216));
assert_eq!(ppo.next(83.61), Some(0.7468846224456406));
assert_eq!(ppo.next(83.15), Some(0.4239424161439804));
assert_eq!(ppo.next(82.84), Some(0.13356017757692787));
assert_eq!(ppo.next(83.99), Some(0.4997247953737079));
assert_eq!(ppo.next(84.55), Some(0.690806261787222));
assert_eq!(ppo.next(84.36), Some(0.503265546395477));
assert_eq!(ppo.next(85.53), Some(0.8097662523725208));
assert_eq!(ppo.next(86.54), Some(1.0883304662225042));
assert_eq!(ppo.next(86.89), Some(1.039770979517235));
assert_eq!(ppo.next(87.77), Some(1.1327352631554244));
assert_eq!(ppo.next(87.29), Some(0.7158876517890078));

Implementations

impl PPO[src]

pub fn new(short_period: u32, long_period: u32) -> PPO[src]

Trait Implementations

impl Indicator<f64, Option<f64>> for PPO[src]

Auto Trait Implementations

impl RefUnwindSafe for PPO

impl Send for PPO

impl Sync for PPO

impl Unpin for PPO

impl UnwindSafe for PPO

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.