Skip to content

Python API Reference

QuantWave's Python package provides three primary surfaces:

  • Polars batch — the .ta namespace (df.lazy().with_columns(pl.col("close").ta.rsi(14), ...))
  • Streaming — lightweight Python wrappers around the same Next<T> Rust implementations (from quantwave import RSI; rsi = RSI(14))
  • Low-level / advanced — direct access to result structs, options helpers, TA-Lib compatible functions (quantwave.talib), discovery (categories, boundary_info), and India-specific analytics

All three surfaces are backed by the same high-performance Rust core and are guaranteed to be bit-identical (validated by property tests against gold-standard vectors).

Quick Start

import polars as pl
import quantwave as qw

# Polars (recommended for research & feature engineering)
df = (
    pl.read_csv("ohlcv.csv")
    .lazy()
    .with_columns([
        pl.col("close").ta.rsi(14).alias("rsi"),
        pl.col("high").ta.supertrend(10, 3).alias("supertrend"),
    ])
    .collect()
)

# Streaming (identical math, perfect for live systems / backtesters)
from quantwave import RSI, SuperTrend

rsi = RSI(14)
st  = SuperTrend(10, 3.0)

for row in data:
    r = rsi.next(row.close)
    s = st.next((row.high, row.low, row.close))

See the full patterns in Batch & Streaming Examples.

What Lives Where

Surface Typical Import Best For Detailed Docs
Polars .ta extension pl.col("close").ta.xxx(...) Feature engineering, research Guides → Indicators
Streaming wrappers from quantwave import RSI, SuperTrend Live systems, custom backtesters Per-indicator pages + notebooks
Result / Options structs from quantwave import results, options Post-processing, risk, India ops This reference + docstrings
Native indicator catalog qw.metadata("rsi") Discovery + docs by slug Complete catalog
Market Structure / PA from quantwave import MarketStructure Event-driven strategies Dedicated PA guides + flagship notebook

Important Notes

  • Most indicator documentation lives in the Guides, not here.
    The manual pages (guides/indicators/native/...) contain formulas, parameters, visuals, edge cases, 3-surface code examples, and authoritative sources. They are the primary reference.

  • The auto-generated pages below document the thin Python glue (result dataclasses, convenience helpers, the polars layer, etc.). They are intentionally lightweight.

  • The heavy mathematical implementations (150+ indicators, Ehlers DSP, geometric patterns, regimes, etc.) are written in Rust. Python merely exposes them.

  • New high-level discovery / introspection helpers (qw.indicators(), qw.metadata(name), streaming class wrappers, parity assertions, etc.) are under active development. When they stabilize they will appear in this section with examples.

Generated Reference

The pages below are produced automatically from the pure-Python portion of the package at build time.