| Crates.io | finlib-ta |
| lib.rs | finlib-ta |
| version | 0.6.0 |
| created_at | 2025-06-25 18:33:56.255204+00 |
| updated_at | 2025-06-25 18:33:56.255204+00 |
| description | Technical analysis library. Implements number of indicators: EMA, SMA, RSI, MACD, Stochastic, etc. |
| homepage | https://github.com/sarsoo/ta-rs |
| repository | https://github.com/sarsoo/ta-rs |
| max_upload_size | |
| id | 1726281 |
| size | 157,489 |
Technical analysis library for Rust.
Add to you Cargo.toml:
[dependencies]
finlib-ta = "0.6.0"
Example:
use finlib_ta::indicators::ExponentialMovingAverage;
use finlib_ta::Next;
// it can return an error, when an invalid length is passed (e.g. 0)
let mut ema = ExponentialMovingAverage::new(3).unwrap();
assert_eq!(ema.next(2.0), 2.0);
assert_eq!(ema.next(5.0), 3.5);
assert_eq!(ema.next(1.0), 2.25);
assert_eq!(ema.next(6.25), 4.25);
See more in the examples here. Check also the documentation.
A data item which represent a stock quote may implement the following traits:
OpenHighLowCloseVolumeIt's not necessary to implement all of them, but it must be enough to fulfill requirements for a particular indicator.
You probably should prefer using DataItem unless you have reasons to implement your own structure.
Indicators typically implement the following traits:
Next<T> (often Next<f64> and Next<&DataItem>) - to feed and get the next valueReset - to reset an indicatorDebugDisplayDefaultCloneSo far there are the following indicators available.
serde - allows to serialize and deserialize indicators. NOTE: the backward compatibility of serialized
data with the future versions of ta is not guaranteed because internal implementation of the indicators is a subject
to change.cargo bench
You can support the project by donating NEAR tokens.
Our NEAR wallet address is ta-rs.near