Donate with Bitcoin! Donate with Ethereum! Donate with BNB!
crates.io version crates.io downloads # TATK, Technical Analysis Toolkit The objective of this crate is analyzing signals and indicators of data and providing additional tools for accurate analysis. There are several other wonderful crates that implement similar algorithms, however they did not meet my personal needs or had minor errors in their calculations. ```toml [dependencies] tatk = { git = "https://github.com/ohkthx/tatk-rs" } ``` ## Features - **Momentum / Moving Averages** - Simple Moving Average (SMA) - Exponential Moving Average (EMA) - Double Exponential Moving Average (DEMA) - McGinley Dynamic Indicator (MD) - On-Balance Volume (OBV) - Rate of Change (ROC) - **Oscillators** - Relative Strength Index (RSI) - Moving Average Convergence and Divergence (MACD) - Bollinger Bands (BBands) - True Range (TR) - Average True Range (ATR) - **Others** - Linear Regression (LineReg) - Variance (Var(X)) - Standard Deviation (SD/STDEV) - Cross (Cross), checks two lines for Golden or Death cross. - **Macros, Traits, and Derives** - [macros.rs](https://github.com/Ohkthx/tatk-rs/tree/main/src/macros.rs) - [traits.rs](https://github.com/Ohkthx/tatk-rs/tree/main/src/traits.rs) - [tatk_derive/lib.rs](https://github.com/Ohkthx/tatk-rs/tree/main/tatk_derive/src/lib.rs) ## Documentation Most of the documentation can be accessed by clicking the following link: [docs.rs](https://docs.rs/tatk/latest/tatk/). That documentation is automatically generated and also accessible from [crates.io](https://crates.io/crates/tatk). ### Traits The following traits are either used by the crate on indicators or to be defined by the user for additional functionality. - **Indicator** - Stats - Basic statistics for the indicator such as: sum, mean, variance, and standard deviation. - Period - Period of window of the data for the indicator. - Next - Add a new data point to the indicator to recalculate value. - **User Defined** - AsValue - Alternative value that can be passed to an Indicators `Next`. - Open - Opening value for the data type. - Close - Closing value for the data type. - Low - Lowest value for the data type. - High - Highest value for the data type. - Volume - Total volume for the data type. - **Others** - Hl2 - Average of the Highest and Lowest values, requires `High` and `Low` to be defined. - Hlc3 - Average of the Highest, Lowest, and Close values, requires `High`, `Low`, and `Close` to be defined. - Ohlc4 - Average of the Open, Highest, Lowest, and Close values, requires `Open`, `High`, `Low`, and `Close` to be defined. ## Examples Following examples can be ran with: `cargo run --example short_id` - **Simple Moving Average (SMA)**: [sma.rs](https://github.com/Ohkthx/tatk-rs/tree/main/examples/sma.rs) - **Exponential Moving Average (EMA)**: [ema.rs](https://github.com/Ohkthx/tatk-rs/tree/main/examples/ema.rs) - **Double Exponential Moving Average (DEMA)**: [dema.rs](https://github.com/Ohkthx/tatk-rs/tree/main/examples/dema.rs) - **Moving Average Convergence Divergence (MACD)**: [macd.rs](https://github.com/Ohkthx/tatk-rs/tree/main/examples/macd.rs) - **Relative Strength Indicator (RSI)**: [rsi.rs](https://github.com/Ohkthx/tatk-rs/tree/main/examples/rsi.rs) - **Bollinger Bands (BBands)**: [bbands.rs](https://github.com/Ohkthx/tatk-rs/tree/main/examples/bbands.rs) - **Average True Range (ATR)**: [atr.rs](https://github.com/Ohkthx/tatk-rs/tree/main/examples/atr.rs) - **McGinley Dynamic Indicator (MD)**: [md.rs](https://github.com/Ohkthx/tatk-rs/tree/main/examples/md.rs) - **On-Balance Volume (OBV)**: [obv.rs](https://github.com/Ohkthx/tatk-rs/tree/main/examples/obv.rs) - **Rate of Change (ROC)**: [roc.rs](https://github.com/Ohkthx/tatk-rs/tree/main/examples/roc.rs) - **Linear Regression (LineReg)**: [linereg.rs](https://github.com/Ohkthx/tatk-rs/tree/main/examples/linereg.rs) - **Traits (Traits)**: [user_traits.rs](https://github.com/Ohkthx/tatk-rs/tree/main/examples/user_traits.rs) ## Tips Appreciated! Wallet addresses are provided below, or click the badges above! ``` Ethereum (ETH): 0x7d75f6a9c021fcc70691fec73368198823fb0f60 Bitcoin (BTC): bc1q75w3cgutug8qdxw3jlmqnkjlv9alt3jr7ftha0 Binance (BNB): 0x7d75f6a9c021fcc70691fec73368198823fb0f60 ```