financial_indicators

Crates.iofinancial_indicators
lib.rsfinancial_indicators
version1.0.0
created_at2024-07-26 05:50:28.242447+00
updated_at2025-05-15 15:36:30.600757+00
descriptionA Rust library providing a comprehensive suite of financial technical indicators for cryptocurrency and stock analysis. Includes trend, momentum, volatility, volume, and other common indicators such as: - MA (Moving Average) - EMA (Exponential Moving Average) - MACD (Moving Average Convergence Divergence) - DMI/ADX (Directional Movement Index / Average Directional Index) - TRIX (Triple Exponential Average) - RSI (Relative Strength Index) - ROC (Rate of Change) - CCI (Commodity Channel Index) - Stochastic Oscillator (KDJ) - MOM (Momentum) - ATR (Average True Range) - Bollinger Bands - STD (Standard Deviation) - OBV (On-Balance Volume) - VOL (Volume) - MFI (Money Flow Index) - VWAP (Volume Weighted Average Price) - SAR (Parabolic SAR) - PSY (Psychological Line) - Williams %R - CR (Cumulative Resistance)
homepagehttps://github.com/rosendolu/financial_indicators
repositoryhttps://github.com/rosendolu/financial_indicators.git
max_upload_size
id1315816
size145,380
rosendo (rosendolu)

documentation

README

Financial Indicators Last Commit

Crates.io Documentation

A Rust library providing various financial algorithms, including but not limited to KDJ and MACD indicators, for technical analysis.

Features

  • Easy integration with existing projects
  • Well-documented and tested

Indicators:

1. Trend Indicators

  • MA (Moving Average)
  • EMA (Exponential Moving Average)
  • MACD (Moving Average Convergence Divergence)
  • DMI/ADX (Directional Movement Index / Average Directional Index)
  • TRIX (Triple Exponential Average)

2. Momentum Indicators

  • RSI (Relative Strength Index)
  • ROC (Rate of Change)
  • CCI (Commodity Channel Index)
  • Stochastic Oscillator (KDJ)
  • MOM (Momentum)

3. Volatility Indicators

  • ATR (Average True Range)
  • Bollinger Bands
  • STD (Standard Deviation)

4. Volume Indicators

  • OBV (On-Balance Volume)
  • VOL (Volume)
  • MFI (Money Flow Index)
  • VWAP (Volume Weighted Average Price)

5. Other Common Indicators

  • SAR (Parabolic SAR)
  • PSY (Psychological Line)
  • Williams %R
  • CR (Cumulative Resistance)

Installation

Add financial_indicators to your Cargo.toml:

cargo add financial_indicators

Or manual add to cargo.toml

[dependencies]
financial_indicators = "0.1.0"

Usage

Here's an example of how to use the library to calculate KDJ indicators:

use financial_indicators::kdj::{calculate_kdj, OHLC};

fn main() {
    let prices = vec![
        OHLC {
            close: 10.0,
            high: 12.0,
            low: 8.0,
        },
        OHLC {
            close: 11.0,
            high: 13.0,
            low: 9.0,
        },
        OHLC {
            close: 12.0,
            high: 14.0,
            low: 10.0,
        },
        OHLC {
            close: 11.5,
            high: 13.5,
            low: 10.5,
        },
        OHLC {
            close: 13.0,
            high: 15.0,
            low: 11.0,
        },
    ];

    let (k_values, d_values, j_values) = calculate_kdj(&prices, 3);
    println!("K values: {:?}", k_values);
    println!("D values: {:?}", d_values);
    println!("J values: {:?}", j_values);
}

Examples

examples

Indicators Docs

indicator anatomy

Contributing

We welcome contributions!👏

License

This project is licensed under the MIT License - see the LICENSE file for details.

Commit count: 0

cargo fmt