Crate ux_indicators[−][src]
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
Since Next<T>
is a generic trait, most of the indicators can work with both input types: f64
and more complex
structures like DataItem.
Example
use core::indicators::ExponentialMovingAverage; use core::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);
List of indicators
- Trend
- Oscillators
- Other
Modules
errors | |
indicators |
Structs
BidAsk | |
DataItem | Data item is used as an input for indicators. |
Frame | |
Indicator | |
Input | |
Ohlcv | |
Plot | |
Slot | |
View |
Enums
DataPoint | |
InputType | |
SlotType |
Traits
Close | Close price of a particular period. |
Factory | Factory trait to create indicator |
High | Highest price of a particular period. |
Low | Lowest price of a particular period. |
Next | Consumes a data item of type |
Open | Open price of a particular period. |
Reset | Resets an indicator to the initial state. |
Volume | Trading volume of a particular trading period. |
Functions
example |
Type Definitions
SlotPtr |