The interface tier of Arithmion, an AI-native quantitative research and trading platform. This package contains the contracts the platform is built on: abstract base classes, typed data carriers, and the entry-point plugin registry. It contains no engine, no providers, and no agent runtime — those live in the Arithmion product, which implements these contracts.
Links — arithmion.com for the product; arithmion.com/learn for the learning center, a free bilingual (English / 中文) quant curriculum covering market structure, statistics, machine learning, and a validation track on multiple testing, PBO and the deflated Sharpe ratio — also available as markdown in quant-learning-path.
The package installs into the apexquant namespace (import apexquant.core),
which is the platform's historical package name; the import path is shared
with the full product so that code written against these contracts runs
unchanged in both.
Data contracts — the shapes that cross every boundary:
bar/signals/result/trade_plan— OHLCV bars, signal proxies, prediction results, trade plansbacktest.result/backtest.serialize— the backtest result carrier and its canonical JSON wire shapepanel— the cross-sectional factor-panel shape and its OHLCV convertersconfig_schema— the typed schema plugins use to declare their configuration surfacemodel_meta— themeta.jsonschema describing trained-model artifacts
Plugin contracts — subclass one of these, register it via an entry point, and the platform discovers it:
strategy/portfolio_strategy— bar-driven and rebalance-driven strategiespredictor— per-bar inferencedatasource/streaming— bounded (batch) and unbounded (live) databroker— order routingengine— the backtest-engine protocol and factorymetric/validation— result metrics and trustworthiness validatorsrisk— risk manager, position sizer, stop policytraining— the trainer contract and the walk-forward window partitioneruniverse/calendar— point-in-time stock pools and trading calendars
Mechanism:
registry/plugins— the domain registry and the entry-point scanner that performs discovery
pip install -e .Requires Python ≥ 3.11. Runtime dependencies are pandas and loguru only.
from apexquant.core.bar import Bar
from apexquant.core.strategy import BaseStrategy, Signal
class Momentum(BaseStrategy):
name = "momentum"
freq = "daily"
def on_bar(self, bar: Bar) -> Signal:
if bar.close > bar.open:
return Signal.BUY
return Signal.HOLDThird-party packages expose implementations through entry-point groups
(apexquant.strategies, apexquant.datasources, apexquant.metrics, …);
see plugins.py for the group inventory and registry.py for the domain
registry the scanner populates.
Interface versioning follows the platform's roadmap: during v0.x no
interface is frozen, and breaking changes are recorded in CHANGELOG.md.
Contracts carry an __apexquant_api_version__ tuple where versioned.
The Arithmion product repository is the source of truth; this repository is
a curated export of its src/apexquant/core interface tier
(scripts/sync_from_apexquant.py performs the sync and enforces the scope).
Issues and contributions against the contracts are welcome here.
Arithmion grew out of ApexQuant, a graduate thesis project on applying deep time-series learning to stock forecasting and quantitative trading:
- Applying Deep Time-Series Learning to Stock Forecasting and Quant Trading — the thesis
- Apexquant — the thesis-era codebase this platform descends from
When the project became the Arithmion platform, the brand changed but the
Python package kept its original apexquant name — frankly, because
renaming it was not worth the churn: imports, entry-point groups
(apexquant.strategies, …), and the __apexquant_api_version__ markers
would all have had to move for zero functional gain. A convenient side
effect is that thesis-era and current code interoperate as-is. The same
applies to the aq shorthand you may see elsewhere in the platform (CSS
tokens, UI prefixes). Wherever you read apexquant or aq, it means
Arithmion.
MIT — see LICENSE.
arithmion-core 是 Arithmion(AI 原生量化平台)的接口层:平台赖以构建的 契约——抽象基类、类型化数据载体、以及基于 entry-point 的插件注册机制。 本仓库不包含引擎实现、数据/券商 provider 或 agent 运行时;它们属于实现了 这些契约的 Arithmion 产品本体。
相关链接——产品在 arithmion.com;学习中心在 arithmion.com/learn:免费的中英双语量化课程, 覆盖市场结构、数理统计、机器学习,以及围绕多重检验、PBO 与 Deflated Sharpe 的验证专线,markdown 版在 quant-learning-path。
包安装在 apexquant 命名空间下(import apexquant.core),与完整产品共享
导入路径:针对这些契约编写的代码在两侧无需修改即可运行。
安装:pip install -e .,要求 Python ≥ 3.11,运行时依赖仅 pandas 与 loguru。
关于 apexquant 与 aq 命名:Arithmion 的前身是毕业设计项目
ApexQuant(论文、
当时的代码库)。品牌更名后
Python 包沿用了原名 apexquant——说白了是改名不值得折腾:导入路径、
entry-point 组名、__apexquant_api_version__ 标记全都得跟着动,却没有
任何功能收益。顺带的好处是论文时期与当前的代码无需迁移即可互通;平台
其它位置的 aq 简写同理。代码中的 apexquant 与 aq 均指 Arithmion。
v0.x 期间接口均不冻结,破坏性变更记录于 CHANGELOG.md。许可证为 MIT。