百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
Y

yata

> 编程语言
开源

又一个技术分析库 [用于 Rust]

397 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

又一个技术分析库 [用于 Rust]

YATA

Yet Another Technical Analysis library

YaTa implements most common technical analysis methods and indicators.

It also provides you an interface to create your own indicators.

toml
[dependencies]
yata = "0.6"

Available moving averages:

  • Simple moving average (SMA);
  • Weighted moving average (WMA);
  • Exponential moving average family: EMA, DMA, TMA, DEMA, TEMA;
  • Simple moving median (SMM);
  • Linear regression moving average (LSMA);
  • Volume weighted moving average (VWMA);
  • Symmetrically weighted moving average (SWMA);
  • Hull moving average (HMA);
  • Running Moving Average (RMA);
  • Triangular Moving Average (TRIMA);
  • Wilder’s Smoothing Average (WSMA);
  • Kaufman Adaptive Moving Average (KAMA);
  • Convolution Moving Average;
  • Variable Index Dynamic Average (Vidya);

See all

Timeseries conversion

  • Timeframe Collapsing;
  • Heikin Ashi;
  • Renko;

Some commonly used methods:

  • Accumulation-distribution index;
  • Commodity channel index;
  • Cross / CrossAbove / CrossUnder;
  • Derivative (differential);
  • Highest / Lowest / Highest-Lowest Delta;
  • Highest Index / Lowest Index;
  • Integral (sum);
  • Mean absolute deviation;
  • Median absolute deviation;
  • Momentum;
  • Past;
  • Rate Of Change (ROC);
  • Reversal points;
  • Standard Deviation;
  • True Range;
  • True Strength Index;
  • Volatility;

See all

Some commonly used indicators:

  • Average Directional Index;
  • Awesome Oscillator;
  • Bollinger Bands;
  • Commodity Channel Index;
  • Detrended Price Oscillator;
  • Ease Of Movement;
  • Elders Force Index;
  • Envelopes;
  • Fisher Transform;
  • Ichimoku Cloud;
  • Keltner Channels;
  • Moving Average Convergence Divergence (MACD);
  • Money Flow Index;
  • Price Channel Strategy;
  • Relative Strength Index (RSI);
  • Stochastic Oscillator;
  • Trix;
  • Woodies CCI;

And many others. See all

Method usage example

rust
use yata::prelude::*;
use yata::methods::EMA;

// EMA of length=3
let mut ema = EMA::new(3, &3.0).unwrap();

ema.next(&3.0);
ema.next(&6.0);

assert_eq!(ema.next(&9.0), 6.75);
assert_eq!(ema.next(&12.0), 9.375);

Indicator usage example

rust
use yata::helpers::{RandomCandles, MA};
use yata::indicators::MACD;
use yata::prelude::*;

let mut candles = RandomCandles::new();
let mut macd = MACD::default();

macd.method1 = "sma-4".parse().unwrap(); // one way of defining methods inside indicators

macd.signal = MA::TEMA(5); // another way of defining methods inside indicators

let mut macd = macd.init(&candles.first()).unwrap();

for candle in candles.take(10) {
	let result = macd.next(&candle);

	println!("{:?}", result);
}

Benchmarks

Methods

  • _w10 - method with window length=10
  • _w100 - method with window length=100
…

Indicators

…

Current unsafe status

By default, there is no unsafe code in the crate. But you can optionally enable unsafe_performance feature throw you Cargo.toml or by --feature flag in your CLI.

unsafe_performance enables some unsafe code blocks, most of them are unsafe access to a vector's elements. For some methods it may increase performance by ~5-10%.

Features

  • serde - enables serde crate support;
  • period_type_u16 - sets PeriodType to u16;
  • period_type_u32 - sets PeriodType to u32;
  • period_type_u64 - sets PeriodType to u64;
  • value_type_f32 - sets ValueType to f32;
  • unsafe_performance - enables optional unsafe code blocks, which may increase performance;

Rust version

YaTa library supports Rust stable except that you can't run benchmarks with it.

Suggestions

You are welcome to give any suggestions about implementing new indicators and methods.

Say thanks

If you like this library, and you want to say thanks, you can do it also by donating to bitcoin address 1P3gTnaTK9LKSYx2nETrKe2zjP4HMkdhvK

Issues· 9 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustindicatorsmoving-averagetechnical-analysistrading

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言