frama

Function frama 

Source
pub fn frama<T: ToPrimitive>(
    data: &[T],
    window: usize,
) -> Result<impl Iterator<Item = f64> + '_, &'static str>
Expand description

Fractal Adaptive Moving Average

Based on argument that market prices are fractal, this algorithm considers fractal shapes as self-similar because they tend to have the same roughness and sparseness regardless of the magnification used to view them.

§Sources

[1]

§Examples

use traquer::smooth;

match smooth::frama(&[1.0,2.0,3.0,4.0,5.0,2.0,3.0,4.0,2.0,3.0,4.0,2.0,3.0,4.0], 3){
    Ok(iter) => {
        let ma = iter.collect::<Vec<f64>>();
    },
    Err(e) => println!("Error: {}", e),
}