• Stars
    star
    584
  • Rank 74,110 (Top 2 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 6 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Technical analysis library for Rust language

Technical Analysis for Rust (ta)

Build Status Crates.io Docs.rs License

Stand With Ukraine

Technical analysis library for Rust.

Getting started

Add to you Cargo.toml:

[dependencies]
ta = "0.4.0"

Example:

use ta::indicators::ExponentialMovingAverage;
use ta::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);

See more in the examples here. Check also the documentation.

Basic ideas

A data item which represent a stock quote may implement the following traits:

  • Open
  • High
  • Low
  • Close
  • Volume

It's not necessary to implement all of them, but it must be enough to fulfill requirements for a particular indicator. You probably should prefer using DataItem unless you have reasons to implement your own structure.

Indicators typically implement the following traits:

  • Next<T> (often Next<f64> and Next<&DataItem>) - to feed and get the next value
  • Reset - to reset an indicator
  • Debug
  • Display
  • Default
  • Clone

List of indicators

So far there are the following indicators available.

  • Trend
    • Exponential Moving Average (EMA)
    • Simple Moving Average (SMA)
  • Oscillators
    • Relative Strength Index (RSI)
    • Fast Stochastic
    • Slow Stochastic
    • Moving Average Convergence Divergence (MACD)
    • Percentage Price Oscillator (PPO)
    • Commodity Channel Index (CCI)
    • Money Flow Index (MFI)
  • Other
    • Minimum
    • Maximum
    • True Range
    • Standard Deviation (SD)
    • Mean Absolute Deviation (MAD)
    • Average True Range (AR)
    • Efficiency Ratio (ER)
    • Bollinger Bands (BB)
    • Chandelier Exit (CE)
    • Keltner Channel (KC)
    • Rate of Change (ROC)
    • On Balance Volume (OBV)

Features

  • serde - allows to serialize and deserialize indicators. NOTE: the backward compatibility of serialized data with the future versions of ta is not guaranteed because internal implementation of the indicators is a subject to change.

Running benchmarks

cargo bench

Donations

You can support the project by donating NEAR tokens.

Our NEAR wallet address is ta-rs.near

License

MIT © Sergey Potapov

Contributors

More Repositories

1

nutype

Rust newtype with guarantees 🇺🇦 🦀
Rust
1,068
star
2

whatlang-rs

Natural language detection library for Rust. Try demo online: https://whatlang.org/
Rust
926
star
3

vim-preview

Vim plugin for previewing markup files(markdown,rdoc,textile,html)
Vim Script
209
star
4

envconfig-rs

Build a config structure from environment variables in Rust without boilerplate
Rust
186
star
5

blogo

Mountable blog engine for Ruby on Rails
Ruby
101
star
6

kinded

Generate Rust enum variants without associated data
Rust
81
star
7

cargo-testify

Watches changes in a rust project, runs test and shows friendly notification
Rust
80
star
8

awesome-programming-books

List of good programming books for beginners and professionals
80
star
9

mago

Magic numbers detector for Ruby source code
Ruby
58
star
10

humble-investing

List of resources that I use for investing research
41
star
11

jsonpath-rs

JSONPath for Rust
Rust
37
star
12

from-typescript-to-rescript

Frontend of https://Inhyped.com written in TypeScript and rewritten in ReScript
TypeScript
29
star
13

telebot

Ruby client for Telegram bot API
Ruby
28
star
14

fast_seeder

Speed up seeding your Rails application using multiple SQL inserts!
Ruby
25
star
15

xplan

Visualizes dependencies between tasks
Rust
22
star
16

dm-rspec

RSpec matchers for DataMapper
Ruby
19
star
17

hellcheck

HTTP health checker implemented in Rust
Rust
19
star
18

vim-esperanto

Vim plugin for typing Esperanto language in any way (Esperanto keyboard, h, x, ^)
Vim Script
15
star
19

crystal-google_translate

Google Translate client for Crystal
Crystal
14
star
20

hail

HTTP load testing tool powered by Rust
Rust
14
star
21

crystal-magma

Crystal interpreter
Crystal
13
star
22

poloniex-rs

Rust client for Poloniex API
Rust
9
star
23

whatlang-ffi

C bindings for whatlang Rust library
C
9
star
24

rustcast

Code for RustCast screencast episodes (https://www.youtube.com/channel/UCZSy_LFJOtOPPcsE64KxDkw)
Rust
8
star
25

crystal-aitk

Artificial Intelligence Tool Kit for Crystal lang
Crystal
8
star
26

tokipona

Ruby library to process constructed language Toki Pona
Ruby
8
star
27

rails3_pg_deferred_constraints

Rails 3 engine which provides a hack to avoid RI_ConstraintTrigger Error bug.
Ruby
7
star
28

dotvim

My .vim
Vim Script
4
star
29

conway-rs

Conway's Game of Life implemented in Rust.
Rust
4
star
30

arbitrary_ext

Provides a way to derive Arbitrary trait but set custom implementation for single fields if necessary.
Rust
4
star
31

crystal-glosbe

Crystal Client for Glosbe API
Crystal
3
star
32

rails_markdown

Allows you to use markdown templates with placeholders in rails application}
Ruby
3
star
33

vim-smartdict

Vim plugin to use translate words (dictionary).
Vim Script
3
star
34

dot-nvim

My nvim config
Vim Script
2
star
35

enum_param-rs

Rust
2
star
36

beep-alarm

Alarm written in bash and based on beep tool
2
star
37

crystal-delemma

Lemmatization tool for German language.implemented in Crystal
Crystal
2
star
38

crystal-telegram_bot

Crystal
2
star
39

whatlang-website

Website for whatlang (whatlang.org)
JavaScript
2
star
40

crystal-icr

Interactive console for Crystal programming language
2
star
41

crystal-cossack

Simple and flexible HTTP client for Crystal with middleware and test support.
2
star
42

greyblake.github.com

My blog
HTML
1
star
43

talks

Public talks / presentations
Vue
1
star
44

alis

Tool to create more flexible aliases.
Ruby
1
star
45

rustcast-travis-demo

Rust
1
star
46

gync

Synchronize data of desktop applications with Git
Ruby
1
star
47

dm-enum

Enumerated models for DataMapper
Ruby
1
star
48

envconfig-rs-old

An easy way to build a config structure form environment variables in Rust without boilerplate.
Rust
1
star
49

crystal-jwt

JWT implementation in Crystal
1
star
50

deutscher_bot

Telegram Bot that helps to learn German, implemented in Crystal
Crystal
1
star