Skip to main content

localquant

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

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

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

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

安装

支持 Linux x86_64、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 x86_64 构建入口为 scripts/build_local_wheel.sh,需要 Python 3.11+、docker 和宿主测试依赖。每个 ABI 使用新 manylinux 容器,依次完成构建、内容校验、安装导入与全量单测,再执行宿主中立目录单测和网关冒烟。全部门禁通过后,dist/ 只保存本次验收的二进制 wheel。标准 python -m build 入口拒绝构建 wheel 和 sdist。设计契约与 Windows 命令见 开发日志/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       # 指定版本

发布顺序:

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

  2. 运行完整矩阵构建入口,验收容器逐版本全量单测、内容门禁、宿主中立目录全量单测与网关冒烟(smoke_cn_etf.py)。

  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.1.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.1.0
File Actions
localquant-0.1.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.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
localquant-0.1.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.17+ x86-64, Linux glibc 2.28+ x86-64 Details for localquant-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
localquant-0.1.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.28+ x86-64, Linux glibc 2.17+ x86-64 Details for localquant-0.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
localquant-0.1.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.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
localquant-0.1.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.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Total release size: 41.7 MB

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

Download URL localquant-0.1.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
7a1e606ff55b59b16e0e791fb39369d4f3aa78156884667815278f09f56add94
BLAKE2b-256 checksum
How to use checksums
3e86cf03a417aec838daee53c790ff9d4ad4d11cd04dfb485199a7036a65b196
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.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL localquant-0.1.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
2a26f67b4aa7128f9d22ecaea7b1efc44823cc450dad3f01077120b3b95a131f
BLAKE2b-256 checksum
How to use checksums
ea39d158cc6919a0bbd62afd010bb68285c1fb0398defc370b1e343fe5dd966d
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.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL localquant-0.1.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
8d7bef0fc86b98d7a5a09a80be240af462b43a2c0d5efc9da71541c2bf09f6e1
BLAKE2b-256 checksum
How to use checksums
14ee2c9fae7478edd9ad0a4e4b227838e559f4c328723365710b239802556728
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.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL localquant-0.1.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
c1be96497f17e2513f6613baa7596d9e16dacd6cbc8551bc4f2789fe29ef3435
BLAKE2b-256 checksum
How to use checksums
3c68e016c521cff049babfb3296dcc786ff0564f91000d23dd97f198f3400f34
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.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL localquant-0.1.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
0f69fb1a49b8fc3f45d929f502ffc40e3209f9504937b4153dbc8bdbb09ebc8f
BLAKE2b-256 checksum
How to use checksums
c501bdb33c038229a957534a96a19dc57499a6dc4ffe24eb083a1b24095b427b
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.1.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.1.0 This release

5 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