[−][src]Crate yata
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.
Some commonly used methods:
- ADI Accumulation-distribution index;
- Cross / CrossAbove / CrossUnder;
- Derivative (differential);
- Highest / Lowest / Highest - Lowest Delta;
- HMA Hull moving average;
- Integral (sum);
- LinReg Linear regression moving average;
- Momentum;
- Reverse points;
- SMA Simple moving average;
- WMA Weighted moving average;
- VWMA Volume weighted moving average;
- EMA, DMA, TMA, DEMA, TEMA Exponential moving average family;
- SWMA Symmetrically weighted moving average.
And many others: See Full list
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, RegularMethods}; use yata::indicators::MACD; use yata::prelude::*; use std::convert::TryInto; let mut candles = RandomCandles::new(); let mut macd = MACD::default(); macd.period3 = 4; // setting signal period MA to 4 macd.method1 = "sma".try_into().unwrap(); // one way of defining methods inside indicators macd.method3 = RegularMethods::TEMA; // 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
Currently there is no unsafe
code in the crate.
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
Modules
core | Some useful features and definitions |
helpers | Additional helping primitives |
indicators | |
methods | Commonly used methods for manipulating timeseries.
Every method implements |
prelude | Contains main traits you need to start using this library |