Module: ma
Source:
ma.rs
Moving average indicators.
Provides [Sma] (Simple), [Ema] (Exponential), [Wma] (Weighted),
and [Hma] (Hull) moving averages with O(1) incremental updates.
Structs
pub struct Sma
#![allow(unused)]
fn main() {
pub struct Sma {
period: usize,
buffer: RingVec,
sum: f64,
};
}
pub struct Ema
#![allow(unused)]
fn main() {
pub struct Ema {
multiplier: f64,
current: Option < f64 >,
};
}
pub struct Wma
#![allow(unused)]
fn main() {
pub struct Wma {
period: usize,
buffer: RingVec,
denominator: f64,
};
}
pub struct Vwma
#![allow(unused)]
fn main() {
pub struct Vwma {
period: usize,
price_buffer: RingVec,
vol_buffer: RingVec,
pv_sum: f64,
v_sum: f64,
};
}
pub struct Lsma
#![allow(unused)]
fn main() {
pub struct Lsma {
period: usize,
buffer: RingVec,
sum_x: f64,
sum_x2: f64,
};
}