Crate ta[][src]

Expand description

ta is a Rust library for technical analysis. It provides number of technical indicators that can be used to build trading strategies for stock markets, futures, forex, cryptocurrencies, etc.

Every indicator is implemented as a data structure with fields, that define parameters and state.

Every indicator implements Next and Reset traits, which are the core concept of the library.

Since Next<T> is a generic trait, most of the indicators can work with both input types: f64 and more complex structures like DataItem.


use ta::indicators::ExponentialMovingAverage;
use ta::Next;

// it can return an error, when an invalid period is passed (e.g. 0)
let mut ema = ExponentialMovingAverage::new(3).unwrap();

assert_eq!(, 2.0);
assert_eq!(, 3.5);
assert_eq!(, 2.25);
assert_eq!(, 4.25);

List of indicators



Data item is used as an input for indicators.


Close price of a particular period.

Highest price of a particular period.

Lowest price of a particular period.

Consumes a data item of type T and returns Output.

Open price of a particular period.

Return the period used by the indicator.

Resets an indicator to the initial state.

Trading volume of a particular trading period.