Expand description
Yet Another Technical Analysis library
YaTa
implements most common technical analysis methods and indicators
It also provides you an interface to create your own indicators.
§Available moving averages:
- Simple moving average (SMA);
- Weighted moving average (WMA);
- Exponential moving average family: EMA, DMA, TMA, DEMA, TEMA;
- Simple moving median (SMM);
- Linear regression moving average (LSMA);
- Volume weighted moving average (VWMA);
- Symmetrically weighted moving average (SWMA);
- Hull moving average (HMA);
- Running Moving Average (RMA);
- Triangular Moving Average (TRIMA);
- Wilder’s Smoothing Average (WSMA);
- Kaufman Adaptive Moving Average (KAMA);
- Convolution Moving Average;
- Variable Index Dynamic Average (Vidya);
§Timeseries conversion
§Some commonly used methods:
- Accumulation-distribution index;
- Commodity channel index;
Cross
/CrossAbove
/CrossUnder
;- Derivative (differential);
- Highest / Lowest / Highest-Lowest Delta;
- Highest Index / Lowest Index;
- Integral (sum);
- Mean absolute deviation;
- Median absolute deviation;
- Momentum;
- Past;
- Rate Of Change (ROC);
- Reversal points;
- Standard Deviation;
- True Range;
- True Strength Index;
- Volatility;
§Some commonly used indicators:
- Average Directional Index;
- Awesome Oscillator;
- Bollinger Bands;
- Commodity Channel Index;
- Detrended Price Oscillator;
- Ease Of Movement;
- Elders Force Index;
- Envelopes;
- Fisher Transform;
- Ichimoku Cloud;
- Keltner Channels;
- Moving Average Convergence Divergence (MACD);
- Money Flow Index;
- Price Channel Strategy;
- Relative Strength Index (RSI);
- Stochastic Oscillator;
- Trix;
- Woodies CCI;
And many others: See Full list
§Method usage example
use yata::prelude::*;
use yata::methods::EMA;
// EMA of length=3
let mut ema = EMA::new(3, &3.0).unwrap();
ema.next(&3.0);
ema.next(&6.0);
assert_eq!(ema.next(&9.0), 6.75);
assert_eq!(ema.next(&12.0), 9.375);
§Indicator usage example
use yata::helpers::{RandomCandles, MA};
use yata::indicators::MACD;
use yata::prelude::*;
let mut candles = RandomCandles::new();
let mut macd = MACD::default();
macd.ma1 = "sma-4".parse().unwrap(); // one way of defining methods inside indicators
macd.signal = MA::TEMA(5); // another way of defining methods inside indicators
let mut macd = macd.init(&candles.first()).unwrap();
for candle in candles.take(10) {
let result = macd.next(&candle);
println!("{:?}", result);
}
§Current usafe status
By default, there is no unsafe
code in the crate. But you can optionally enable unsafe_performance
feature throw you Cargo.toml
or by --feature
flag in your CLI.
usafe_performance
enables some unsafe code blocks, most of them are unsafe access to a vector’s elements. For some methods it may increase performance by ~5-10%.
§Suggestions
You are welcome to give any suggestions about new indicators and methods
§Say thanks
If you like this library and you want to say thanks, you can do it also by donating to bitcoin address 1P3gTnaTK9LKSYx2nETrKe2zjP4HMkdhvK