Skip to main content

alphatonic

CI License: MIT

alphatonic is a Python library for testing trading signals. Give alphatonic your scores and prices, and it measures how well the scores predict future returns.

With alphatonic you can:

  • Measure cross-sectional and time-series information coefficients, including single-asset signals.
  • Estimate uncertainty with Newey–West standard errors and a block bootstrap.
  • Assess how costly a signal would be to trade, using rank-persistence and bucket-turnover statistics.
  • Render an offline HTML tearsheet, and browse your trials with alphatonic serve.

Start with the tutorial, or browse the docs.

alphatonic evaluates predictive association; it does not build factors or simulate portfolios, costs or P&L. See scope and alternatives.

Try it

Python 3.11 or newer. Install from PyPI:

python -m pip install alphatonic
from alphatonic import evaluate
from alphatonic.demo import synthetic_market

factor, prices = synthetic_market(n_assets=30, n_bars=500, ic=0.04, seed=7)  # or your own tables
result = evaluate(factor, prices, horizons=[1, 5])

result.summary.query("method == 'spearman'")[["horizon", "mean", "ci95_lower", "ci95_upper"]]
result.tearsheet("tearsheet.html")

Open tearsheet.html in your browser.

Changelog

See the changelog for what changed in each release.

Development

uv sync --all-extras --locked
uv run pytest
uv run ruff check . && uv run ruff format --check .
uv run pyright

See Contributing for setup, tests and the release process.

License

MIT License. Copyright 2026 Manuel Blum.

Metadata

Release files for alphatonic 0.2.0

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

Source distribution (sdist)

Source distribution for alphatonic 0.2.0
File Size Uploaded Provenance Actions
alphatonic-0.2.0.tar.gz 343.8 kB Without provenance Details for alphatonic-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for alphatonic 0.2.0
File Interpreter ABI Platform Actions
alphatonic-0.2.0-py3-none-any.whl Python 3 none any Details for alphatonic-0.2.0-py3-none-any.whl

Total release size: 611.1 kB

Release files / alphatonic-0.2.0.tar.gz

Download URL alphatonic-0.2.0.tar.gz
Size 343.8 kB
Tags Source
SHA-256 checksum
How to use checksums
41891ff0924a89c8a8362107987f716a74cf2e0e9bff77613a0347cf92c46d4c
BLAKE2b-256 checksum
How to use checksums
fc8090e438769d685747495e7dedfcef8efd8deb7609e258f6f3c9558d29df65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / alphatonic-0.2.0-py3-none-any.whl

Download URL alphatonic-0.2.0-py3-none-any.whl
Size 267.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00bbd7949c8910e44e192dd5d9370fef4c98e4ba4a43ca649477bf712dcce4ec
BLAKE2b-256 checksum
How to use checksums
70764685153b82e68eaa058cfaeed0d274a77d6696809a735328b86dff512475
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for alphatonic 0.2.0

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