Skip to main content

221-indicator Polars-native quant library: Rust core, .ta/.bt namespaces, streaming parity, Ehlers DSP, backtest engine

Project description

QuantWave (Python)

Polars-native quantitative finance — 221 Rust indicators, Ehlers DSP, price action, regimes, and a built-in backtest engine with batch ↔ streaming parity.

pip install "quantwave[polars]"
quantwave doctor

Documentation · vs TA-Lib & pandas-ta · FAQ · llms.txt


Install

pip install "quantwave[polars]"

The wheel bundles quantwave._quantwave (indicators), quantwave_plugins (expression .ta), and quantwave._backtest. The [polars] extra adds Polars for .ta / .bt namespaces.


Example 1 — Polars batch (.ta)

import polars as pl
import quantwave  # registers pl.col().ta and LazyFrame.bt

df = pl.DataFrame({
    "high":  [101.0, 102.0, 103.0, 102.0, 104.0],
    "low":   [99.0, 100.0, 101.0, 100.0, 102.0],
    "close": [100.0, 101.0, 102.0, 101.0, 103.0],
})

out = (
    df.lazy()
    .with_columns(
        pl.col("close").ta.rsi(timeperiod=14).alias("rsi"),
        pl.col("close").ta.supertrend("high", "low", period=10, multiplier=3.0).alias("st"),
    )
    .collect()
)
print(out.tail())

Example 2 — Live streaming (parity with batch)

import quantwave as qw

cls = qw.streaming_class("rsi")
rsi = qw.wrap_streaming(cls(period=14), name="rsi")

for price in closes:
    val = rsi.next(price)
    if rsi.is_ready:
        print(price, val)

# Optional: qw.assert_parity("rsi", {"period": 14}, closes)

Example 3 — Backtest (.bt in the same package)

import polars as pl
import quantwave

bars = pl.DataFrame({
    "timestamp": range(20),
    "close": [100 + i * 0.5 for i in range(20)],
    "signal": [0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, -1.0, -1.0, 0.0] * 2,
})

report = (
    bars.lazy()
    .bt.backtest_with_report(signal="signal", close_col="close", timestamp_col="timestamp")
)
print(report.metrics())

See examples/03_backtest_quick.py in this directory.


Architecture

pip install quantwave[polars]
        │
        ├── quantwave._quantwave   # Rust indicators (Next<T> core)
        ├── quantwave_plugins    # pl.col("close").ta.* expression plugins
        ├── quantwave._backtest  # Rust simulation engine
        │
        ├── import quantwave
        │     ├── pl.col().ta.*        batch indicators (plugins)
        │     ├── df.lazy().bt.*       backtest namespace (bt_polars)
        │     ├── qw.streaming_class   live bar-by-bar
        │     ├── qw.metadata / assert_parity / CLI
        │     └── quantwave.backtest   BacktestEngine direct API
        │
        └── Docs: lavs9.github.io/quantwave/api/ (mkdocstrings)

One Rust math path powers batch, streaming, and backtest signal evaluation — validated by gold-standard tests.


Discovery & CLI

import quantwave as qw

print(len(qw.indicators()), "names")
meta = qw.metadata("rsi")
print(meta.warmup_bars, meta.category)
quantwave list --category "Classic"
quantwave info supertrend
quantwave doctor

Examples in this repo

Script What it shows
examples/01_rsi_polars.py Polars .ta batch
examples/02_supertrend_streaming.py RSI streaming + readiness
examples/03_backtest_quick.py .bt.backtest_with_report

Learn more

MIT licensed.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

quantwave-0.7.0-cp39-abi3-win_amd64.whl (12.1 MB view details)

Uploaded CPython 3.9+Windows x86-64

quantwave-0.7.0-cp39-abi3-manylinux_2_34_x86_64.whl (12.9 MB view details)

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

quantwave-0.7.0-cp39-abi3-manylinux_2_34_aarch64.whl (14.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.34+ ARM64

quantwave-0.7.0-cp39-abi3-macosx_11_0_arm64.whl (11.6 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file quantwave-0.7.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: quantwave-0.7.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 12.1 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quantwave-0.7.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b9ceef31d61c3ac9706ee74c16d95d72a6bf113839d118d5f15f063c21beae9c
MD5 91b541f91be3d4af2f35cc2ded1b8271
BLAKE2b-256 90cbb9d37adf99e5e259590e340db1a3d282a11f0ecc16c3b61a548a4b8b9a88

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantwave-0.7.0-cp39-abi3-win_amd64.whl:

Publisher: release.yml on lavs9/quantwave

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantwave-0.7.0-cp39-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for quantwave-0.7.0-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1b28efc4528cd7f154375a42835bf8d6868157ccc1139dc3d9c789b41c0586b5
MD5 56100b54bc915732516f311bc5b52105
BLAKE2b-256 00210bc9ecbabd7af5cc248645fab582e4990aab1580cdffa0a9eb24d45df75f

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantwave-0.7.0-cp39-abi3-manylinux_2_34_x86_64.whl:

Publisher: release.yml on lavs9/quantwave

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantwave-0.7.0-cp39-abi3-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for quantwave-0.7.0-cp39-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 c7c448092713cf7ec8a7155a7c84051b56dbdb0bc5ff564900c8527e1ee0e46b
MD5 65f1817930e3219a4cf748fe6ee78c00
BLAKE2b-256 44274322ce32efbe292e235a648ca26c4ad9895d7f0e0d726e20d1c127513c65

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantwave-0.7.0-cp39-abi3-manylinux_2_34_aarch64.whl:

Publisher: release.yml on lavs9/quantwave

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantwave-0.7.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for quantwave-0.7.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 29d80f89e2bc2c8dbc97159dcfddbee53af6cd7afa9c815a73739fc4aa48fadb
MD5 b244e784ea74290b7e7104078af5f197
BLAKE2b-256 91559b596f044fb969d3e1107da74015923e9f0bd4973522bdf2446a787ad1c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantwave-0.7.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on lavs9/quantwave

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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