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 and equal-weighted cosine 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.3.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.3.0
File Size Uploaded Provenance Actions
alphatonic-0.3.0.tar.gz 343.9 kB Without provenance Details for alphatonic-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 618.3 kB

Release files / alphatonic-0.3.0.tar.gz

Download URL alphatonic-0.3.0.tar.gz
Size 343.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4b626aa0c45f369d25c0082bb6f8c4c560f2986d6b50f0579f064be6e0cc8a3e
BLAKE2b-256 checksum
How to use checksums
ee50a778c3ba82ab9bf4e2eae49300c66170e0460381376ca4bf3a91b3768149
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.3.0-py3-none-any.whl

Download URL alphatonic-0.3.0-py3-none-any.whl
Size 274.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
294e82369603dc2851cb12a1e43d9383ee66082b7e44495a046d81c7c7319105
BLAKE2b-256 checksum
How to use checksums
945077a926f3b23fa95ddc9a6de6837c242caa6bfac2b625a56f0259acd2148f
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.3.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