Skip to main content

RTTA

pyrtta is a low-latency C++23/nanobind library for tick-by-tick technical analysis, online change detection, market regime monitoring, and research signals. The Python import package is rtta.

The design goal is to make accidental crystal-balling hard. Algorithms are stateful, causal objects: callers feed one tick at a time through update(...) or advance(...), and the object can only react to data it has already seen. That surface is meant to fit live systems, interactive research modes, and market simulators where orders must be decided before the next observation is available.

Scope

The current benchmark registry covers 188 algorithms:

  • Classic technical indicators: moving averages, oscillators, trend, volatility, price transforms, bands, channels, volume indicators, and returns.
  • State-space and adaptive filters: Kalman variants, particle filters, interacting multiple models, Gaussian-process and kernel envelopes, and tracking filters.
  • Market microstructure and liquidity widgets: order-flow imbalance, bid-ask bounce, spread features, quote/trade intensity, VPIN, Amihud, Kyle lambda, liquidity drought, spread explosion, and execution-cost/slippage regimes.
  • Online change and drift detection: CUSUM, Page-Hinkley, ADWIN, DDM, EDDM, HDDM, KSWIN, EWMA z-score shifts, residual/error/hit-rate/calibration/feature drift, and rolling two-window mean, variance, correlation, beta, and spread/liquidity shift detectors.
  • Online regime filters: threshold and hysteresis regimes, volatility/ATR/ realized-variance/trend-chop/liquidity/spread/volume/order-flow/correlation/ beta/pairs-spread regimes, bounded BOCPD, online HMM, sticky HMM-style, Markov-switching volatility, Gaussian mixture, and semi-Markov-style filters.
  • Finance-specific live widgets: volatility breakout, compression/expansion, microstructure-noise, quote-stuffing, lead-lag, open/close and auction/continuous-market transitions, cross-asset correlation breaks, and streaming residual-based cointegration breakdown monitoring.

Installation

pip install pyrtta

Usage

import rtta

rsi = rtta.RSI()

for close in close_stream:
    value = rsi.update(close)
    if value > 70.0:
        reduce_position()

Use advance(...) when the caller only needs to update state and does not need a Python result object for that tick:

ema = rtta.EMA(window=30.0)

for close in warmup_ticks:
    ema.advance(close)

current = ema.update(next_close)

Most indicators expose:

  • update(...): consume one sample and return the current value/result.
  • advance(...): consume one sample and return None.
  • last() or last_<field>(): read the most recent state without advancing.
  • batch(...): causal bulk catch-up for restart/research workflows. It consumes input in chronological order and leaves the object ready for the next live tick.
  • replay_update(...), replay_advance(...), and replay_update_outputs(...): C++ replay paths for causal catch-up and latency benchmarking.

Multi-output indicators return immutable C++ result structs with read-only fields. Scalar convenience methods such as update_upper(...) and last_upper() are available where an indicator has named fields.

Benchmarks

Latency results are maintained on the standalone benchmark page. The benchmark page records CPU and runtime metadata for current Intel, Apple Silicon, and Loongson runs.

Development

This project is built as a C++23 nanobind extension with CMake through scikit-build-core.

poetry install --with build,dev,docs --no-root
poetry run python -m pip install --no-build-isolation -e .
poetry run pytest

Build the static HTML documentation with:

poetry run python tools/build_html_docs.py

To build a wheel:

poetry run python -m build --wheel

Citation

If you use RTTA in research, benchmarks, or published work, cite it with:

@misc{deprince2026pyrtta,
  author       = {DePrince, Adam},
  title        = {{pyrtta}: Low Latency Incremental Technical Analysis},
  year         = {2026},
  version      = {0.2.5},
  howpublished = {\url{https://github.com/adamdeprince/rtta}},
  note         = {Python package name: pyrtta; import package name: rtta}
}

The same entry is available in CITATION.bib.

Metadata

Release files for pyrtta 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrtta 0.2.5
File Size Uploaded Provenance Actions
pyrtta-0.2.5.tar.gz 2.4 MB Without provenance Details for pyrtta-0.2.5.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pyrtta 0.2.5
File Interpreter ABI Platform Actions
pyrtta-0.2.5-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for pyrtta-0.2.5-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pyrtta-0.2.5-cp312-abi3-macosx_26_0_arm64.whl CPython 3.12 abi3 macOS 26.0+ ARM64 Details for pyrtta-0.2.5-cp312-abi3-macosx_26_0_arm64.whl

Total release size: 6.5 MB

Release files / pyrtta-0.2.5.tar.gz

Download URL pyrtta-0.2.5.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
fc03974d0a407728d1c8d6cdaefd329483f49163a8e419960065e97fbe7d59f8
BLAKE2b-256 checksum
How to use checksums
8f1ff93b5a81898ec6b948bca705a553fed9177770c6509297656d404fb396e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / pyrtta-0.2.5-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyrtta-0.2.5-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.5 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
843e896f3de9264f7fb82b212e4ed0de8fc7c077787f30ded19e0b3752c119b9
BLAKE2b-256 checksum
How to use checksums
39c3e15e11fc8ce408ce608ba336f4f1c7e590f3d75c243a5ef5b11626b6a1fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / pyrtta-0.2.5-cp312-abi3-macosx_26_0_arm64.whl

Download URL pyrtta-0.2.5-cp312-abi3-macosx_26_0_arm64.whl
Size 1.6 MB
Tags CPython 3.12 abi3 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
ede21dd30553b3de5cee9e8a7fcab684465e8b98efeb7ddc261ed8a955442d4b
BLAKE2b-256 checksum
How to use checksums
bb2b109fccf9dbeeabd7a610ef05e553d5edb38d4f7888a71933002feb87e7ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for pyrtta 0.2.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page