Struct yata::methods::TSI[][src]

pub struct TSI { /* fields omitted */ }

True Strength Index of specified short period and long period for timeseries of type ValueType

         EMA(EMA(momentum_1, long_period), short_period)
TSI = ------------------------------------------------------
       EMA(EMA(ABS(momentum_1), long_period), short_period)

Parameters

Tuple of (short_length, long_length) (PeriodType, PeriodType)

Input type

Input type is ValueType

Output type

Output type is ValueType

Examples

use yata::prelude::*;
use yata::methods::TSI;

// TSI with short length=3, long length=10
let mut tsi = TSI::new(3, 10, 3.0).unwrap();

tsi.next(3.0);
tsi.next(6.0);

println!("{}", tsi.next(9.0));
println!("{}", tsi.next(12.0));

Performance

O(1)

Implementations

impl TSI[src]

pub fn new(
    short_period: PeriodType,
    long_period: PeriodType,
    value: ValueType
) -> Result<Self, Error>
[src]

Creates new instance of TSI

Trait Implementations

impl Clone for TSI[src]

impl Copy for TSI[src]

impl Debug for TSI[src]

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

impl Method<'_> for TSI[src]

type Params = (PeriodType, PeriodType)

Method parameters

type Input = ValueType

Input value type

type Output = Self::Input

Output value type

impl Serialize for TSI[src]

Auto Trait Implementations

impl RefUnwindSafe for TSI

impl Send for TSI

impl Sync for TSI

impl Unpin for TSI

impl UnwindSafe for TSI

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.