Skip to main content

localquant

localquant 是面向本地数据网关的算法交易回测框架,覆盖策略编写、回测执行与报告导出的完整链路。

  • 数据:经 dataapi 网关获取行情与财务数据,数据加载与回测在同一进程内完成

  • 资产:A 股、场内基金(ETF/LOF)、国内期货,支持日频与 1 分钟

  • 扩展:Mod Hook 机制支持对接第三方库与自定义数据准备层

安装

支持 Linux x86_64、Windows amd64、CPython 3.10–3.14,从 PyPI 安装:

python -m pip install localquant

使用文档

  • 回测框架用户指南:../各类skills/localquant-backtest/references (策略编写、API、配置与报告)

  • 源码仓库约束与内部设计:AGENTS.md 与 开发日志/

环境与构建

发行物仅为 Cython 编译的二进制 wheel,Python 明文仅保留 examples/ 与 _version.py;保留 docstring,不携带 DWARF 调试段。安全边界为无法一键还原源码。

Linux 构建入口为 scripts/build_local_wheel.sh,每个 ABI 使用新 manylinux 容器,逐版完成编译、内容校验、安装导入与全量单测,再执行宿主中立目录单测和网关冒烟。Windows 入口为 scripts/build_windows_wheel.py,每个 ABI 使用独立 venv 和 MSVC,逐版完成编译、内容校验、安装导入、CLI 与全量单测;Linux 宿主可用 scripts/build_windows_wheel.sh 驱动 windows-home 构建机。

stage 使用 Python 3.11+。各平台门禁通过后才将对应 wheel 写入 dist/,保留另一平台产物。标准 python -m build 入口拒绝构建 wheel 和 sdist。构建契约与环境要求见 开发日志/2026-10-27_发行包Cython编译加密分发管线.md;本机入口见 ../VENV.md。

版本与发布

版本的唯一事实来源为 localquant/_version.py 中的 __version__;运行时、包元数据和构建脚本均读取该值。 版本采用 主版本.次版本.补丁:兼容的错误修复与性能优化递增补丁,兼容的功能扩展递增次版本,公开接口、配置或结果结构的不兼容变更递增主版本。 验收版使用 1.0.0rc1 等编号;同一已发布版本不得替换代码或 wheel。撮合、费用和绩效算法修复即使属于补丁,也应在对应功能文档说明生效口径及可能影响的结果。

在本目录执行,脚本的可选参数是 Python 解释器路径与 cp 版本列表;指定矩阵须包含宿主 Python 版本:

/data/workspace/.venv/bin/python -m pytest tests/unittest -q
bash scripts/build_local_wheel.sh /data/workspace/.venv/bin/python              # cp310–cp314 全矩阵
bash scripts/build_local_wheel.sh /data/workspace/.venv/bin/python cp313       # 指定版本
bash scripts/build_windows_wheel.sh /data/workspace/.venv/bin/python           # Windows 全矩阵

发布顺序:

  1. 修改唯一版本文件并维护受影响的公开契约,运行相关测试和完整框架单测。

  2. 运行 Linux 和 Windows 完整矩阵入口,验收两平台逐版本全量单测、内容门禁、安装导入与 Linux 宿主网关冒烟(smoke_cn_etf.py)。核对 dist/ 为同一版本的十个二进制 wheel。

  3. 将验收后的各平台 wheel 放入 ../各类skills/localquant-backtest/packages/,目录只保留当前发行版本的全部平台 wheel;更新 localquant-wheel.sha256、框架 skill 的安装说明和 VENV.md,本机环境显式安装目标 wheel。策略构建 skill 与框架 skill 同级分发,引用这份文档和发行包。

  4. 核对 localquant.__version__、安装元数据、wheel 版本与校验值一致后提交,给发布提交打 localquant/v<版本> 标签,如 localquant/v1.0.0。日常提交不要求发布 wheel。

  5. 使用 PyPI 上传凭据校验并上传 dist/ 中的二进制 wheel,随后从公网 PyPI 安装核对版本:

python -m twine check --strict dist/*.whl
python -m twine upload --repository pypi dist/*.whl

回测结果在 backtest_settings.framework_version 保存运行时版本,供结果核对与复现使用。

Metadata

Release files for localquant 0.2.0

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

Built distributions (wheels)

Table of built distributions (wheels) for localquant 0.2.0
File Actions
localquant-0.2.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for localquant-0.2.0-cp314-cp314-win_amd64.whl
localquant-0.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for localquant-0.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
localquant-0.2.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for localquant-0.2.0-cp313-cp313-win_amd64.whl
localquant-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for localquant-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
localquant-0.2.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for localquant-0.2.0-cp312-cp312-win_amd64.whl
localquant-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for localquant-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
localquant-0.2.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for localquant-0.2.0-cp311-cp311-win_amd64.whl
localquant-0.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for localquant-0.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
localquant-0.2.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for localquant-0.2.0-cp310-cp310-win_amd64.whl
localquant-0.2.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for localquant-0.2.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Total release size: 73.3 MB

Release files / localquant-0.2.0-cp314-cp314-win_amd64.whl

Download URL localquant-0.2.0-cp314-cp314-win_amd64.whl
Size 6.3 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
c00a1e23f9934f985cddc2d7a928200df3ce67f6f2d5051e45623e3548d5cc5f
BLAKE2b-256 checksum
How to use checksums
0156b4b4771b0fb7be43fab8b9ade242a40e20c1295703fbb9a0d195711715a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / localquant-0.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL localquant-0.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 8.2 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
aa721d5415d96d134451748f388246d50c699b36b3e2bdae918bcb9a2b5e51bb
BLAKE2b-256 checksum
How to use checksums
504c6eee343d2918fa98ca1b5a5724db487196fd4f0801eacd09fa342c2abf56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / localquant-0.2.0-cp313-cp313-win_amd64.whl

Download URL localquant-0.2.0-cp313-cp313-win_amd64.whl
Size 6.1 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
68c8d9eb03f1a20bb0039c8c3debeccf422856f914fe45406119886bc11ecde6
BLAKE2b-256 checksum
How to use checksums
847c0ac4fe8926ff4590658de63b2bf1e5cabab81a5a3d503a7ab90ba2e3aa29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / localquant-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL localquant-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 8.1 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7d5862b3748cc2afb660ffb16c554cc3528781efa27309479d636d58b43cb102
BLAKE2b-256 checksum
How to use checksums
6e148fd74c2b2b4e915950ae20f2a56a9a669aca6f2e5348003a47e0b8521632
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / localquant-0.2.0-cp312-cp312-win_amd64.whl

Download URL localquant-0.2.0-cp312-cp312-win_amd64.whl
Size 6.2 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
6d82fe7ee9c42540f5b9fce88991b1741adac457be664a7077481868ba1e6ded
BLAKE2b-256 checksum
How to use checksums
e21af5522b1c0e230b23454565256389371b8d30d0613ee43db27384892a9004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / localquant-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL localquant-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 8.2 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
05d49f522ecb0eed9a9b2d4655e037d30ba9f3c9afa8011bd72f644ef59a4a4a
BLAKE2b-256 checksum
How to use checksums
efabae0ede1d1368d62060a8d17bdb45e718e7dd2790074440478979240f57f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / localquant-0.2.0-cp311-cp311-win_amd64.whl

Download URL localquant-0.2.0-cp311-cp311-win_amd64.whl
Size 6.4 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
a3c1315c7c357ac46d1e8aee653ff600c17417390e5fc23143aa71c7d1e19882
BLAKE2b-256 checksum
How to use checksums
dc95a9eb1cf88e25c4d16b5be2dc4e869c91fc67929379a5ebdd89684fbd0115
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / localquant-0.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL localquant-0.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 8.6 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
da4edbbf37b40cd8c16d7d004e490843a0e045f95185c7d487d0628602f56dfd
BLAKE2b-256 checksum
How to use checksums
f89910bdf6862aabb2b63252abd6ffc8ac4c9c363cbfe33a9d7326eb510b238a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / localquant-0.2.0-cp310-cp310-win_amd64.whl

Download URL localquant-0.2.0-cp310-cp310-win_amd64.whl
Size 6.5 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
d253cb392ec610e2d760fa90a144c3d5cb5797bf13a5e9029532131642cc890b
BLAKE2b-256 checksum
How to use checksums
5188e4b7e3dea7bb0b86e6f0dcbd15a97883d197dc59d8f9198c08eba254af43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / localquant-0.2.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL localquant-0.2.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 8.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3914ebb12a67a67861d38f11d74065bd693a01968dd49f9a6205dd9b3ac5bee1
BLAKE2b-256 checksum
How to use checksums
6424aeb980009dd62a3d69080dc63c28dbc8e9d4758928cdf108131b9694ccdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Security for localquant 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

10 release files No provenance

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