pub struct HullMa { /* private fields */ }Expand description
Hull Moving Average indicator.
A responsive moving average that reduces lag while maintaining smoothness. Developed by Alan Hull.
§Formula
HullMA = WMA(2 * WMA(n/2) - WMA(n), sqrt(n))
§Example
use quant_indicators::{Indicator, HullMa};
use quant_primitives::Candle;
use chrono::Utc;
use rust_decimal_macros::dec;
let ts = Utc::now();
let candles: Vec<Candle> = (0..25).map(|i| {
Candle::new(dec!(100), dec!(110), dec!(90), dec!(100) + rust_decimal::Decimal::from(i), dec!(1000), ts).unwrap()
}).collect();
let hull = HullMa::new(20).unwrap();
let series = hull.compute(&candles).unwrap();Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HullMa
impl RefUnwindSafe for HullMa
impl Send for HullMa
impl Sync for HullMa
impl Unpin for HullMa
impl UnsafeUnpin for HullMa
impl UnwindSafe for HullMa
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more