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.4},
  howpublished = {\url{https://github.com/adamdeprince/rtta}},
  note         = {Python package name: pyrtta; import package name: rtta}
}

The same entry is available in CITATION.bib.

Release files for pyrtta 0.2.4

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.4
File Size Uploaded
pyrtta-0.2.4.tar.gz 2.3 MB Details

Built distributions (wheels)

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

Total release size: 5.9 MB

Release files / pyrtta-0.2.4.tar.gz

Download URL pyrtta-0.2.4.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
e3ffe40d2d3d80f82ccc0ff34cf9217683c5bccdab22a976a8e7ffac9b95cfd7
BLAKE2b-256 checksum
How to use checksums
f84c5eab60fb6e2faea782f5b238046df2f90f4f2af6dd9cdbc4b1ac5372cf5b
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.4-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyrtta-0.2.4-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.3 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
44aca330ce9f34cb23fbc006d8d5bfbbd19b4924048c012f173648ba279f3f8b
BLAKE2b-256 checksum
How to use checksums
e7b747bef6bd212bebc7f6e120b958810333d7bd0df5a329f9f3bbe421354fa8
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.4-cp312-abi3-macosx_26_0_arm64.whl

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

Release history Release notifications | RSS feed

This release

0.2.4 This release

3 release files

0.2.2

4 release files

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