tulip_rs 0.1.6

High-performance technical analysis library โ€” 100+ indicators and 60+ candlestick patterns with SIMD acceleration
Documentation

TulipRS

High-performance technical analysis in Rust.

TulipRS implements 100+ technical indicators and 77+ candlestick patterns with first-class SIMD acceleration. Process multiple assets or multiple parameter sets in a single CPU pass, stream live bars into stateful indicators without reprocessing history, and call everything from Rust or Python with the same universal API.

๐Ÿ“– Full documentation


Why TulipRS?

TulipRS Tulip C / TA-Lib
SIMD โ€” multiple assets โœ… N assets in one pass โŒ one asset at a time
SIMD โ€” multiple options โœ… N parameter sets in one pass โŒ one parameter set at a time
Stateful streaming โœ… resume from IndicatorState โŒ full recompute each tick
Optional outputs โœ… free in the same pass โŒ separate call + full scan
Language bindings Rust + Python (more planned) C, various wrappers

When optional intermediate outputs are needed (sub-EMAs, TR, AD line, etc.) TulipRS is 1.3ร— โ€“ 8.7ร— faster than running the equivalent TA-Lib calls.


Installation

Rust

Add TulipRS to your Cargo.toml. The crate is distributed via Git:

[dependencies]
tulip_rs = { git = "https://github.com/me60732/tulip_rs" }

Nightly required. TulipRS uses portable_simd. The correct nightly version is pinned automatically by rust-toolchain.toml โ€” no manual toolchain management needed.

To disable the SIMD multi-asset / multi-option variants (reduces compile time):

tulip_rs = { git = "https://github.com/me60732/tulip_rs", default-features = false }

Python

pip install tulip-rs

Build from source with native CPU optimisations:

git clone https://github.com/me60732/tulip_rs_python
cd tulip_rs_python
RUSTFLAGS="-C target-cpu=native" maturin develop --release

Quick Start

Every indicator follows the same signature โ€” learn it once, use it everywhere.

Rust

use tulip_rs::indicators::ema::indicator;

let close = vec![81.59, 81.06, 82.87, 83.00, 83.61,
                 83.15, 82.84, 83.99, 84.55, 84.36_f64];

// inputs: &[&[f64]]  |  options: &[f64]  |  optional_outputs: Option<&[bool]>
let (outputs, state) = indicator(&[close.as_slice()], &[5.0], None).unwrap();

println!("{:?}", outputs[0]); // EMA(5) values

// Streaming: feed new bars without reprocessing history
let new_bar = [85.10_f64];
let (next_outputs, next_state) = state.batch_indicator(&[&new_bar], None).unwrap();

Python

import numpy as np
import tulip_rs

close = np.array([81.59, 81.06, 82.87, 83.00, 83.61,
                  83.15, 82.84, 83.99, 84.55, 84.36], dtype=np.float64)

outputs, state = tulip_rs.indicators.ema.indicator([close], [5.0])
print(outputs[0])  # EMA(5) values

# Streaming
next_outputs, next_state = state.batch_indicator([np.array([85.10])], None)

SIMD โ€” same indicator, N assets at once (Rust)

use tulip_rs::indicators::ema::indicator_by_assets;

// 4 assets processed simultaneously in one CPU pass
let inputs = [asset1.as_slice(), asset2.as_slice(),
              asset3.as_slice(), asset4.as_slice()];

let results = indicator_by_assets::<4>(&inputs, &[14.0], None).unwrap();

Benchmarks

Benchmarks compare TulipRS (Rust scalar, Rust SIMD) against the reference C implementation (Tulip Indicators) and TA-Lib across 8 real market symbols.

โ†’ Benchmark results โ†’ How to run the benchmarks


Documentation

Page Description
Getting Started Installation, feature flags, calling convention, first examples
Indicators โ€” Overview Full indicator index with inputs, options, and output counts
Indicator API info(), optional outputs, min_data, min_data_accuracy
SIMD By-assets and by-options modes, lane counts, when to use each
State Management Streaming computation, chunked processing, JSON serialisation
Candlestick Patterns 60+ patterns with bullish/bearish forecasting
Language Bindings Python (PyO3/maturin) details and planned bindings

Language Support

Language Status Package
Rust โœ… Native tulip_rs (this repo)
Python โœ… Supported tulip_rs_python ยท pip install tulip-rs
Node.js / WASM ๐Ÿ”œ Planned โ€”
R ๐Ÿ”œ Planned โ€”
Julia ๐Ÿ”œ Planned โ€”

License

MIT