Module yata::methods[][src]

Expand description

Commonly used methods for manipulating timeseries. Every method implements Method trait.

To create a method instance use Method::new. To get new output value over the input value use Method::next.

// creating Weighted Moving Average of length `5`
use yata::prelude::*;
use yata::methods::WMA;

let mut wma = WMA::new(5, 20.0).unwrap();

let input_value = 34.51;
let output_value = wma.next(input_value);

Examples

use yata::prelude::*;
use yata::methods::SMA;

let mut sma = SMA::new(3, 5.0).unwrap();
sma.next(5.0);
sma.next(4.0);
assert_eq!(sma.next(6.0), 5.0);
assert_eq!(sma.next(2.0), 4.0);
assert_eq!(sma.next(-2.0), 2.0);

Modules

renko

Renko implementation entities

Structs

ADI

Accumulation Distribution Index of specified length for timeseries of OHLCV

CCI

Commodity channel index of specified length for time series of type ValueType

CollapseTimeframe

Converting between different timeframes.

Conv

Convolution Moving Average with specified weights for timeseries of ValueType.

Cross

Searches for two timeseries lines of type ValueType cross each other.

CrossAbove

Searches for value timeseries line crosses base line upwards

CrossUnder

Searches for value timeseries line crosses base line downwards

DEMA

Double Exponential Moving Average of specified length for timeseries of type ValueType

DMA

Simple shortcut for EMA over EMA

Derivative

Derivative of specified window length for timeseries of ValueType

EMA

Exponential Moving Average of specified length for timeseries of type ValueType

HMA

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

HeikinAshi

Converts default OHLCVs into Heikin Ashi OHLCVs

Highest

Returns highest value over the last length values for timeseries of type ValueType

HighestIndex

Returns highest value index over the last length values for timeseries of type ValueType

HighestLowestDelta

Calculates absolute difference between highest and lowest values over the last length values for timeseries of type ValueType

Integral

Integrates (summarizes) ValueType values for the given window size length

LinReg

Linear regression moving average for last length values of timeseries of type ValueType

LinearVolatility

Calculate moving linear volatility for last length values of type ValueType

LowerReversalSignal

Searches for lower reversal points over last left+right+1 values of type ValueType

Lowest

Returns lowest value over the last length values for timeseries of type ValueType

LowestIndex

Returns lowest value index over the last length values for timeseries of type ValueType

MeanAbsDev

Mean absolute deviation of specified length for timeseries of type ValueType

MedianAbsDev

Median absolute deviation of specified length for timeseries of type ValueType

Momentum

Momentum calculates difference between current value and n-th value back, where n = length

Past

Moves timeseries by length items forward

RMA

Running Moving Average of specified length for timeseries of type ValueType

RateOfChange

Rate of change calculates relative difference between current value and n-th value back, where n = length

Renko

Converts timeseries to Renko timeseries

ReversalSignal

Searches for reversal points over last left+right+1 values of type ValueType

SMA

Simple Moving Average of specified length for timeseries of type ValueType

SMM

Simple Moving Median of specified length for timeseries of type ValueType

SWMA

Symmetrically Weighted Moving Average of specified length for timeseries of ValueType.

StDev

Moving Standard Deviation over the window of size length for timeseries of type ValueType

TEMA

Triple Exponential Moving Average of specified length for timeseries of type ValueType

TMA

Simple shortcut for EMA over EMA over EMA (or EMA over DMA, or DMA over EMA)

TR

True Range

TRIMA

Triangular Moving Average of specified length for timeseries of type ValueType

TSI

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

UpperReversalSignal

Searches for upper reversal points over last left+right+1 values of type ValueType

VWMA

Volume Weighed Moving Average of specified length for timeseries of type (ValueType, ValueType) which represents pair of values (value, volume)

Vidya

Variable Index Dynamic Average of specified length for timeseries of type ValueType

WMA

Weighted Moving Average of specified length for timeseries of type ValueType.

WSMA

Wilder’s Smoothing Average of specified length for timeseries of type ValueType

Type Definitions

Change

Just an alias for Momentum method

Differential

Just an alias for Derivative

LSMA

Just an alias for LinReg.

MMA

Just an alias for RMA

MTM

Just an alias for Momentum method

ROC

Just an alias for RateOfChange method

SMMA

Just an alias for RMA

Sum

Just an alias for Integral