pub struct HullMovingAverage { /* private fields */ }Expand description
Hull Moving Average (HMA).
A moving average that attemps to reduce or remove price lag while maintaining curve smoothness.
§Example
use finlib_ta::indicators::HullMovingAverage;
use finlib_ta::Next;
let mut hma = HullMovingAverage::new(3).unwrap();
assert_eq!(hma.next(10.0), 10.0);
assert_eq!(hma.next(13.0), 14.0);
assert_eq!(hma.next(16.0), 18.0);
assert_eq!(hma.next(14.0), 13.5);§Links
Implementations§
Trait Implementations§
Source§impl Clone for HullMovingAverage
impl Clone for HullMovingAverage
Source§fn clone(&self) -> HullMovingAverage
fn clone(&self) -> HullMovingAverage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HullMovingAverage
impl Debug for HullMovingAverage
Source§impl Default for HullMovingAverage
impl Default for HullMovingAverage
Source§impl Display for HullMovingAverage
impl Display for HullMovingAverage
Source§impl Next<f64> for HullMovingAverage
impl Next<f64> for HullMovingAverage
Auto Trait Implementations§
impl Freeze for HullMovingAverage
impl RefUnwindSafe for HullMovingAverage
impl Send for HullMovingAverage
impl Sync for HullMovingAverage
impl Unpin for HullMovingAverage
impl UnwindSafe for HullMovingAverage
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