[−][src]Struct wma_rs::WMA
Weighted Moving Average
use wma_rs::WMA; use ta_common::traits::Indicator; let mut wma = WMA::new(5); assert_eq!(wma.next(81.59), None); assert_eq!(wma.next(81.06), None); assert_eq!(wma.next(82.87), None); assert_eq!(wma.next(83.00), None); assert_eq!(wma.next(83.61), Some(82.82466666666667)); assert_eq!(wma.next(83.15), Some(83.066)); assert_eq!(wma.next(82.84), Some(83.1)); assert_eq!(wma.next(83.99), Some(83.39866666666667)); assert_eq!(wma.next(84.55), Some(83.80933333333334)); assert_eq!(wma.next(84.36), Some(84.05333333333333)); assert_eq!(wma.next(85.53), Some(84.63733333333333)); assert_eq!(wma.next(86.54), Some(85.39933333333333)); assert_eq!(wma.next(86.89), Some(86.03133333333334)); assert_eq!(wma.next(87.77), Some(86.76333333333332)); assert_eq!(wma.next(87.29), Some(87.12066666666666));
Implementations
impl WMA
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WMA
impl Send for WMA
impl Sync for WMA
impl Unpin for WMA
impl UnwindSafe for WMA
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,