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.6.1-cp39-abi3-win_amd64.whl (16.3 MB view details)

Uploaded CPython 3.9+Windows x86-64

quantwave-0.6.1-cp39-abi3-manylinux_2_34_x86_64.whl (18.3 MB view details)

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

quantwave-0.6.1-cp39-abi3-manylinux_2_34_aarch64.whl (17.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.34+ ARM64

quantwave-0.6.1-cp39-abi3-macosx_11_0_arm64.whl (15.8 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: quantwave-0.6.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 16.3 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.6.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d6089c1980f41b72af190801eff8f2364110dc4369f27729f7e1e97874e53b11
MD5 32399900be88ee8150ad7f571741acaf
BLAKE2b-256 3e589200539e5ac81499597aff82b112353e288392ce3ced8c05c69ddba2b5ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantwave-0.6.1-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.6.1-cp39-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for quantwave-0.6.1-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 56eb8b4c6f882d60bd429af5c326adfbf787e134d132ef7c2aa41d712a4bbe5d
MD5 e7e7d86e034ad9940efc720299cc3a5d
BLAKE2b-256 dfffe8a51ff2466676e1573091d1c8cf194da658d9a94b098e8a2091edd2dd10

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantwave-0.6.1-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.6.1-cp39-abi3-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for quantwave-0.6.1-cp39-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 c07f57c2ae74a85c45135dc81e136333438d083400dca29160e8e07ba0b22da1
MD5 c91fd2ef9c35755f66e5aa0f0074a601
BLAKE2b-256 1aafeefbbdce3efa36b420018b6c5a3a42e6bd331487e7f34a22a4ba54b663c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantwave-0.6.1-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.6.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for quantwave-0.6.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 294f05b3813db9e694982e270d2f7199963acbf6504c607a4340109c48e22648
MD5 b2f79ce7508886f926a376ccbd84a4e1
BLAKE2b-256 964e5384527704c126605af1d40efc071ecb0696977b5c29112158357e6259dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantwave-0.6.1-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