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 implementation entities
Structs§
- Converting between different timeframes.
- Convolution Moving Average with specified
weights
for timeseries ofValueType
. - Searches for two timeseries lines of type
ValueType
cross each other. - Searches for
value
timeseries line crossesbase
line upwards - Searches for
value
timeseries line crossesbase
line downwards - Returns highest value over the last
length
values for timeseries of typeValueType
- Returns highest value index over the last
length
values for timeseries of typeValueType
- Calculates absolute difference between highest and lowest values over the last
length
values for timeseries of typeValueType
- Integrates (summarizes)
ValueType
values for the given window sizelength
- Calculate moving linear volatility for last
length
values of typeValueType
- Returns lowest value over the last
length
values for timeseries of typeValueType
- Returns lowest value index over the last
length
values for timeseries of typeValueType
- Momentum calculates difference between current value and n-th value back, where n =
length
- Moves timeseries by
length
items forward - Rate of change calculates relative difference between current value and n-th value back, where n =
length
- Converts timeseries to Renko timeseries
- Symmetrically Weighted Moving Average of specified
length
for timeseries ofValueType
. - Triangular Moving Average of specified
length
for timeseries of typeValueType
- Volume Weighed Moving Average of specified
length
for timeseries of type (ValueType
,ValueType
) which represents pair of values (value
,volume
)
Type Aliases§
- Just an alias for Momentum method
- Just an alias for Derivative
- Just an alias for
LinReg
. - Just an alias for RMA
- Just an alias for Momentum method
- Just an alias for RateOfChange method
- Just an alias for RMA
- Just an alias for Integral