Skip to main content

Streaming-first technical indicators: incremental, fast, install-free.

Project description

Wickra — streaming-first technical indicators

CI CodeQL codecov GitHub release crates.io PyPI npm License: PolyForm-NC OpenSSF Scorecard Build provenance Docs

Streaming-first technical indicators. Install with pip install wickra — no system dependencies.

Wickra is a multi-language technical-analysis library with a Rust core and bindings for Python, Node.js, and WebAssembly. Every indicator is a state machine that updates in O(1) per new data point, so live trading bots and historical backtests share the exact same implementation.

import numpy as np
import wickra as ta

# Batch: classic TA-Lib-style usage
prices = np.linspace(100, 200, 1000)
rsi = ta.RSI(14)
values = rsi.batch(prices)              # numpy array, NaN during warmup

# Streaming: same indicator, fed tick by tick
rsi = ta.RSI(14)
for price in live_feed:
    value = rsi.update(price)           # O(1) — no recomputation over history
    if value is not None and value > 70:
        print("overbought")

Documentation

Full documentation lives at docs.wickra.org:

Why Wickra exists

The Python TA ecosystem has plenty of libraries — TA-Lib, pandas-ta, finta, talipp, tulipy — and every one of them shares the same blind spot:

Library Install pain Streaming Multi-language Active
★ Wickra clean yes Python + Node + WASM + Rust yes
TA-Lib (Python) yes (C deps) no no barely
pandas-ta clean no no slow
finta clean no no stale
ta-lib-python yes (C deps) no no barely
talipp clean yes no yes
Tulip Indicators yes (C deps) no partial stale
ooples (C#) clean no C# only yes

Wickra is the only library that combines all of: clean install, streaming, multi-language reach, and active maintenance.

Benchmark: how much faster is "streaming-first"?

The numbers below were measured on a single developer workstation and are not guaranteed to reproduce identically on different hardware — absolute µs values depend on CPU, memory clock and OS scheduler. Read them as relative speedups between libraries on identical input, not as a universal performance contract.

  • Reproduced on: Windows 11 Pro 26200, AMD Ryzen 9 9950X, 64 GB DDR5, Rust 1.92 (release profile, lto = "fat", codegen-units = 1), Python 3.12, Node 20.
  • Reproduce yourself: pip install -e bindings/python[bench] then python -m benchmarks.compare_libraries. The script auto-detects every installed peer library and runs them on the same generated inputs as Wickra. The CI job cross-library-bench runs the same script on every push and uploads the raw report as a build artefact.

Lower µs/op = faster. Wickra wins every batch category outright, and the streaming gap widens linearly with how much history a batch-only library has to recompute on every tick.

Batch — single full pass over a 20 000-bar series

Reading the table: each cell shows that library's runtime, plus how many times slower it is than Wickra in parentheses. marks the winner per row.

Indicator ★ Wickra finta talipp
SMA(20) 95.6 µs ★ 343.5 µs (3.6× slower) 7 640.6 µs (79.9× slower)
EMA(20) 64.6 µs ★ 223.1 µs (3.5× slower) 12 160.9 µs (188.2× slower)
RSI(14) 126.2 µs ★ 1 107.1 µs (8.8× slower) 15 792.2 µs (125.1× slower)
MACD(12, 26, 9) 119.0 µs ★ 531.8 µs (4.5× slower) 49 788.1 µs (418.2× slower)
Bollinger(20, 2.0) 105.3 µs ★ 812.0 µs (7.7× slower) 130 938.3 µs (1 243.7× slower)
ATR(14) 123.5 µs ★ 5 144.8 µs (41.7× slower) 28 816.0 µs (233.4× slower)

Streaming — per-tick latency after seeding with 5 000 historical bars

A batch-only library has to re-run its full indicator over the entire history on every new tick; Wickra updates state in O(1).

Indicator ★ Wickra (per tick) talipp (per tick)
RSI(14) 0.119 µs ★ 1.644 µs (13.8× slower)

TA-Lib and pandas-ta are not included here because both fail to install cleanly on Windows without C build tooling — which is precisely the install pain Wickra was built to remove. The benchmark script auto-detects every peer library it can find and runs them on the same inputs as Wickra; install them in your environment to see those rows light up too.

Run the suite yourself:

pip install -e bindings/python[bench]
python -m benchmarks.compare_libraries

Indicators

295 streaming-first indicators across nineteen families. Every one passes the batch == streaming equivalence test, reference-value tests, and reset semantics tests. Each has a per-indicator deep dive (formula, parameters, warmup) at docs.wickra.org.

Family Indicators
Moving Averages SMA, EMA, WMA, DEMA, TEMA, HMA, KAMA, SMMA, TRIMA, ZLEMA, T3, VWMA, ALMA, McGinley Dynamic, FRAMA, VIDYA, JMA, Alligator, EVWMA
Momentum Oscillators RSI (Wilder), Anchored RSI, Stochastic, CCI, ROC, Williams %R, MFI, Awesome Oscillator, MOM, CMO, TSI, PMO, StochRSI, Ultimate Oscillator, RVI, PGO, KST, SMI, Laguerre RSI, Connors RSI, Inertia
Trend & Directional MACD, ADX (+DI/-DI), ADXR, Aroon, TRIX, Aroon Oscillator, Vortex, Random Walk Index, Trend Intensity Index, Wave Trend Oscillator, Mass Index, Choppiness Index, Vertical Horizontal Filter
Price Oscillators PPO, DPO, Coppock, Accelerator Oscillator, Balance of Power, APO, AO Histogram, CFO, Zero-Lag MACD, Elder Impulse, STC
Volatility & Bands ATR, Bollinger Bands, Keltner Channels, Donchian Channels, NATR, StdDev, Ulcer Index, Historical Volatility, Bollinger Bandwidth, %B, True Range, Chaikin Volatility, RVI (Relative Volatility Index), Parkinson Volatility, Garman-Klass Volatility, Rogers-Satchell Volatility, Yang-Zhang Volatility
Bands & Channels MA Envelope, Acceleration Bands, STARC Bands, ATR Bands, Hurst Channel, LinReg Channel, Standard Error Bands, Double Bollinger Bands, TTM Squeeze, Fractal Chaos Bands, VWAP StdDev Bands
Trailing Stops Parabolic SAR, SuperTrend, Chandelier Exit, Chande Kroll Stop, ATR Trailing Stop, HiLo Activator, Volty Stop, Yo-Yo Exit, Donchian Channel Stop, Percentage Trailing Stop, Step Trailing Stop, Renko Trailing Stop
Volume OBV, VWAP (cumulative + rolling), ADL, Volume-Price Trend, Chaikin Money Flow, Chaikin Oscillator, Force Index, Ease of Movement, Klinger Volume Oscillator, Volume Oscillator, NVI, PVI, Williams A/D, Anchored VWAP, Demand Index, TSV, VZO, Market Facilitation Index
Price Statistics Typical Price, Median Price, Weighted Close, Linear Regression, Linear Regression Slope, Z-Score, Linear Regression Angle, Variance, Coefficient of Variation, Skewness, Kurtosis, Standard Error, Detrended StdDev, R², Median Absolute Deviation, Autocorrelation, Hurst Exponent, Pearson Correlation, Beta, Pairwise Beta, Pair Spread Z-Score, Lead-Lag Cross-Correlation, Cointegration, Relative Strength A-vs-B, Spearman Correlation
Ehlers / Cycle (DSP) MAMA, FAMA, Fisher Transform, Inverse Fisher Transform, SuperSmoother, Hilbert Dominant Cycle, Sine Wave, Decycler, Decycler Oscillator, Roofing Filter, Center of Gravity, Cybernetic Cycle, Adaptive Cycle, Empirical Mode Decomposition, Ehlers Stochastic, Instantaneous Trendline
Pivots & S/R Classic Pivots, Fibonacci Pivots, Camarilla, Woodie Pivots, DeMark Pivots, Williams Fractals, ZigZag
DeMark TD Setup, TD Sequential, TD DeMarker, TD REI, TD Pressure, TD Combo, TD Countdown, TD Lines, TD Range Projection, TD Differential, TD Open, TD Risk Level
Ichimoku & Charts Ichimoku Kinko Hyo (Tenkan, Kijun, Senkou A/B, Chikou), Heikin-Ashi
Alt-Chart Bars Renko (box-size bricks), Kagi (reversal-amount lines), Point & Figure (X/O columns)
Candlestick Patterns Doji, Hammer, Inverted Hammer, Hanging Man, Shooting Star, Engulfing, Harami, Morning/Evening Star, Three White Soldiers/Black Crows, Piercing Line/Dark Cloud Cover, Marubozu, Tweezer, Spinning Top, Three Inside Up/Down, Three Outside Up/Down, Two Crows, Upside Gap Two Crows, Identical Three Crows, Three Line Strike, Three Stars in the South, Abandoned Baby, Advance Block, Belt-hold, Breakaway, Counterattack, Doji Star, Dragonfly Doji, Gravestone Doji, Long-Legged Doji, Rickshaw Man, Evening Doji Star, Morning Doji Star, Gap Side-by-Side White, High-Wave, Hikkake, Modified Hikkake, Homing Pigeon, On-Neck, In-Neck, Thrusting, Separating Lines, Kicking, Kicking by Length, Ladder Bottom, Mat Hold, Matching Low, Long Line, Short Line, Rising Three Methods, Falling Three Methods, Upside Gap Three Methods, Downside Gap Three Methods, Stalled Pattern, Stick Sandwich, Takuri, Closing Marubozu, Opening Marubozu, Tasuki Gap, Unique Three River, Concealing Baby Swallow
Microstructure Order-Book Imbalance (Top-1 / Top-N / Full), Microprice, Quoted Spread, Depth Slope, Signed Volume, Cumulative Volume Delta, Trade Imbalance, Effective Spread, Realized Spread, Kyle's Lambda, Footprint
Derivatives Funding Rate, Funding Rate Mean, Funding Rate Z-Score, Funding Basis, Open-Interest Delta, OI / Price Divergence, OI-Weighted Price, Long/Short Ratio, Taker Buy/Sell Ratio, Liquidation Features, Term-Structure Basis, Calendar Spread
Market Profile Value Area (POC / VAH / VAL), Volume Profile (histogram), TPO Profile, Initial Balance, Opening Range
Risk / Performance Sharpe Ratio, Sortino Ratio, Calmar Ratio, Omega Ratio, Max Drawdown, Average Drawdown, Drawdown Duration, Pain Index, Value at Risk, Conditional Value at Risk (CVaR), Profit Factor, Gain/Loss Ratio, Recovery Factor, Kelly Criterion, Treynor Ratio, Information Ratio, Alpha (Jensen)

Every candlestick pattern emits a signed per-bar value — +1.0 bullish, −1.0 bearish, 0.0 none — so the family drops straight into a feature matrix as one column each. Doji is direction-less by default (+1.0 / 0.0); construct it in signed mode (Doji::new().signed(), Doji(signed=True), new Doji(true)) for a dragonfly / gravestone ±1 reading.

Adding a new indicator means implementing one trait in Rust; all four bindings inherit it automatically.

Languages

Binding Install Example
Python (PyO3) pip install wickra examples/python/backtest.py
Node.js (napi-rs) npm install wickra examples/node/backtest.js
Browser / WASM npm install wickra-wasm examples/wasm/index.html
Rust cargo add wickra examples/rust/src/bin/backtest.rs

Each binding ships several runnable examples (streaming, backtest, live feed); examples/README.md is the full cross-language index.

The wickra-core crate is unsafe-forbidden, so every binding inherits a memory-safe implementation.

Rust API

use wickra::{Indicator, BatchExt, Chain, Ema, Rsi, Sma};

// Streaming or batch — same trait, same code.
let mut sma = Sma::new(14)?;
let out: Vec<Option<f64>> = sma.batch(&[1.0, 2.0, 3.0, 4.0, 5.0]);

let mut rsi = Rsi::new(14)?;
for price in live_feed {
    if let Some(v) = rsi.update(price) {
        println!("RSI = {v}");
    }
}

// Compose indicators: RSI(7) on top of EMA(14).
let mut chain = Chain::new(Ema::new(14)?, Rsi::new(7)?);
chain.update(price);

Live data sources

wickra-data (separate crate, opt-in) ships:

  • A streaming OHLCV CSV reader.
  • A tick-to-candle aggregator with arbitrary timeframes.
  • A candle resampler for multi-timeframe analysis (1m → 5m → 1h on the fly).
  • A Binance Spot WebSocket kline adapter (feature live-binance).
use wickra::{Indicator, Rsi};
use wickra_data::live::binance::{BinanceKlineStream, Interval};

let mut stream = BinanceKlineStream::connect(&["BTCUSDT".into()], Interval::OneMinute).await?;
let mut rsi = Rsi::new(14)?;
while let Some(event) = stream.next_event().await? {
    if event.is_closed {
        if let Some(v) = rsi.update(event.candle.close) {
            println!("RSI = {v:.2}");
        }
    }
}

A Python live-trading example using the public websockets package lives at examples/python/live_trading.py.

Project layout

wickra/
├── crates/
│   ├── wickra-core/         core engine + all 295 indicators
│   ├── wickra/              top-level facade crate (publishes on crates.io) + benches/
│   └── wickra-data/         CSV reader, tick aggregator, live exchange feeds
├── bindings/
│   ├── python/              PyO3 + maturin (publishes on PyPI)
│   ├── node/                napi-rs (publishes on npm)
│   └── wasm/                wasm-bindgen (browsers, bundlers, Node)
├── examples/                examples/README.md indexes every language
│   ├── data/                real BTCUSDT OHLCV datasets, one per timeframe
│   ├── rust/                Rust workspace member (`wickra-examples`)
│   ├── python/              backtest, live trading, parallel assets, multi-tf
│   ├── node/                streaming, backtest, live trading (load `wickra`)
│   └── wasm/                browser demo for `wickra-wasm`
└── .github/workflows/       CI and release pipelines

Rust benchmarks live in crates/wickra/benches/; runnable Rust examples live in the workspace member crate at examples/rust/. There is no top-level benches/ directory.

Building everything from source

# Rust core + tests
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
cargo bench -p wickra

# Python binding (requires Rust toolchain + maturin)
cd bindings/python
maturin develop --release
pytest

# WASM binding (requires wasm-pack + wasm32-unknown-unknown target)
wasm-pack build bindings/wasm --target web --release --features panic-hook

# Node binding (requires @napi-rs/cli)
cd bindings/node && npm install && npm run build && npm test

Testing

Every layer is covered; run the suites with the commands in Building everything from source.

  • wickra-core: unit tests per indicator — textbook reference values (Wilder RSI, Bollinger Bands, MACD, ATR, Stochastic), batch == streaming equivalence, reset semantics, NaN/Inf handling, and property tests.
  • wickra-data: unit tests for CSV decoding, the tick aggregator, the resampler, and the Binance payload parser.
  • bindings/python: pytest covering smoke checks, streaming/batch equivalence, reference values, lifecycle, input validation, and dict/tuple candle inputs.
  • bindings/node: node --test cases for batch, streaming, and reference values across all indicators.
  • bindings/wasm: wasm-bindgen-test cases for constructors, equivalence, and reference values.

Contributing

Contributions are very welcome — issues, bug reports, ideas, and pull requests all land in the same place: https://github.com/wickra-lib/wickra.

A short orientation for first-time contributors:

  • Adding an indicator. Implement the Indicator trait in crates/wickra-core/src/indicators/<name>.rs, wire it into indicators/mod.rs and the crate root, and add reference-value tests, a batch == streaming equivalence test, and (where it makes sense) a proptest. The four bindings inherit your indicator automatically once you expose it in the language wrappers.
  • Fixing a numeric bug. Add a failing test that pins the textbook value first, then fix the math. Property tests in crates/wickra-core catch most regressions; please don't disable them.
  • Improving a binding. Each binding lives under bindings/<lang> with its own tests; please keep the batch == streaming invariant.
  • Style. cargo fmt --all + cargo clippy --workspace --all-targets -- -D warnings are CI gates; running them locally before pushing keeps reviews short.

For larger architectural changes, open an issue first so we can sketch the shape together before you invest the time.

License

Licensed under the PolyForm Noncommercial License 1.0.0. See LICENSE.

In plain English: use it, fork it, modify it, redistribute it, file issues, send pull requests — all welcome. Personal projects, research, education, non-profits, government, hobby trading bots: all fine. The one thing that's not allowed is commercial sale of the software or of services built around it. If you want to use Wickra commercially, get in touch about a license.

Disclaimer

Wickra is an indicator toolkit, not a trading system. Values it computes are deterministic transforms of the input data — they are not financial advice and they do not predict the market. Any use of this library in a production trading context is at your own risk.

The library is provided as is, without warranty of any kind; see LICENSE for the full terms.


GitHub stars GitHub forks GitHub issues

If Wickra saved you time, the cheapest way to say thanks is to ⭐ the repo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wickra-0.4.5.tar.gz (568.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

wickra-0.4.5-cp39-abi3-win_arm64.whl (835.4 kB view details)

Uploaded CPython 3.9+Windows ARM64

wickra-0.4.5-cp39-abi3-win_amd64.whl (989.8 kB view details)

Uploaded CPython 3.9+Windows x86-64

wickra-0.4.5-cp39-abi3-musllinux_1_2_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

wickra-0.4.5-cp39-abi3-musllinux_1_2_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

wickra-0.4.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

wickra-0.4.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

wickra-0.4.5-cp39-abi3-macosx_11_0_arm64.whl (921.0 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

wickra-0.4.5-cp39-abi3-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file wickra-0.4.5.tar.gz.

File metadata

  • Download URL: wickra-0.4.5.tar.gz
  • Upload date:
  • Size: 568.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for wickra-0.4.5.tar.gz
Algorithm Hash digest
SHA256 3ded79106a5dd9919b110145d9b6e2cdc56cf634600417a1b266cfcad253914a
MD5 50066366ea6929bb90ba536e1b76568f
BLAKE2b-256 afcf1065fff410f2077bc30d451f126c80f591206da1bdca86746fe87812b4dd

See more details on using hashes here.

File details

Details for the file wickra-0.4.5-cp39-abi3-win_arm64.whl.

File metadata

  • Download URL: wickra-0.4.5-cp39-abi3-win_arm64.whl
  • Upload date:
  • Size: 835.4 kB
  • Tags: CPython 3.9+, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for wickra-0.4.5-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 2f50cee2cb1495328af9af9838df6270c26d63ec6c97cb52b0504767220c62b1
MD5 e9b8f4e4eb67c44f44a7ab42944a14ad
BLAKE2b-256 4a3f6ffd17cea66ba98534b101c4635eecf0185db077222260b8f7dbb00c41ad

See more details on using hashes here.

File details

Details for the file wickra-0.4.5-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: wickra-0.4.5-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 989.8 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for wickra-0.4.5-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ea5daafafd00c1effcd4059d91fcfdccc85911b2f8a2e0808cc0590d1e8353d1
MD5 78cecbd91fc9f8aeabbbd69638806b5a
BLAKE2b-256 5167dee2a5b0f1ac963a1cb5e7869bcdfcbc25306a7fd5055f0cade96edee436

See more details on using hashes here.

File details

Details for the file wickra-0.4.5-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for wickra-0.4.5-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a7679a07cd761b1b875c5226a37785757a31add8d9970ad4d94a5bb31380aa70
MD5 0ac744afafaed97f15cb225a144c9024
BLAKE2b-256 dff998478fe19f9434c1e389676a649d16d1cfb5be7f126bfe1e2d3dadf1acdb

See more details on using hashes here.

File details

Details for the file wickra-0.4.5-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for wickra-0.4.5-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 149211ea6cc236299a2ee9bc278e7e69e6c1bc6f0fdf2eb42e88a6395b0cd538
MD5 b1ac09799b11cb60469fbb4280abfe15
BLAKE2b-256 76edcc06f4d4df99e623933414995429777e14edfedd8780d620c78297186f24

See more details on using hashes here.

File details

Details for the file wickra-0.4.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wickra-0.4.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 db53b8d757fbb3f61916ff50981d3b717379b7748ab050506e94b738ba30ea4e
MD5 809d36c09fba7d4210b2354d89326520
BLAKE2b-256 3652b72517c673fb85050b4547778543106b4fd9cee1b65afd2dea33b2f84df9

See more details on using hashes here.

File details

Details for the file wickra-0.4.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for wickra-0.4.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e4a3c0915d7804d28fa2997f73b2a6332f3d52bca35f174db3724127378a552f
MD5 fd29c6f110821fdc62811949c13820b5
BLAKE2b-256 57002669e5fea535ab735fbcee385c5eac1a3d36adf0791d3c7236ad124c1be4

See more details on using hashes here.

File details

Details for the file wickra-0.4.5-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wickra-0.4.5-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04855bebd2f43a0e697ae922f97e81b695a0df1458b6d9d1bbec4791fae8007e
MD5 6994ec119811ba25680ffd32591bd4b2
BLAKE2b-256 650a89989272f056f77630e685b75a41a6a0d087beacf84cdaac4e953a422cca

See more details on using hashes here.

File details

Details for the file wickra-0.4.5-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for wickra-0.4.5-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 194a815d52942abb8ea45a8186226b562eaf7860cd7f7aa7e22349f0150f7865
MD5 e6287be024ee662e944d1aeaa9c79d8a
BLAKE2b-256 5049d76ab78c13a4f606605d9d54bc5e55757c9dcca6795d6918a7bfe66a8860

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page