dpo

Function dpo 

Source
pub fn dpo<T: ToPrimitive>(
    data: &[T],
    window: usize,
    mamode: Option<MaMode>,
) -> impl Iterator<Item = f64> + '_
Expand description

Detrended Price Oscillator

Measure the difference between a security’s price and its trend and attempts to identify cyclicality. It behaves closer to a momentum indicator

§Usage

Suggests uptrend when above zero or when value reaches prior low of oscillator.

§Examples

use traquer::{trend,smooth};

trend::dpo(
    &[1.0,2.0,3.0,4.0,5.0,6.0,4.0,5.0],
    6, Some(smooth::MaMode::SMA)).collect::<Vec<f64>>();