[][src]Struct yata::methods::HMA

pub struct HMA { /* fields omitted */ }

Hull Moving Average for last length values for timeseries of type ValueType

HMA = WMA from (2*WMA over length/2 − WMA over length) over sqrt(length))

Parameters

Has a single parameter length: PeriodType

length should be > 1

Input type

Input type is ValueType

Output type

Output type is ValueType

Examples

use yata::prelude::*;
use yata::methods::HMA;
use yata::helpers::RandomCandles;

let mut candles = RandomCandles::default();

let mut hma = HMA::new(5, candles.first().close);

candles.take(5).enumerate().for_each(|(index, candle)| {
	println!("HMA at #{} is {}", index, hma.next(candle.close));
});

Perfomance

O(1)

See also

Weighted Moving Average

Trait Implementations

impl Clone for HMA[src]

impl Debug for HMA[src]

impl<'de> Deserialize<'de> for HMA[src]

impl Method for HMA[src]

type Params = PeriodType

Method parameters

type Input = ValueType

Input value type

type Output = Self::Input

Output value type

impl Serialize for HMA[src]

Auto Trait Implementations

impl RefUnwindSafe for HMA

impl Send for HMA

impl Sync for HMA

impl Unpin for HMA

impl UnwindSafe for HMA

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.