Skip to content
项目

关于

quantitative security portfolio analysis. The analysis pipeline including data storage abstraction, alpha calculation, ML based alpha combining and portfolio calculation.

安全与隐私

这些数字如何统计

可以做什么

  • Unified data protocol: tables exchanged across modules use pyarrow.Table; pandas is not used as a data interchange layer.
  • File data: Parquet, Arrow IPC, Feather, and CSV are supported; Parquet uses Zstandard compression by default.
  • Database data: ConnectorX reads Arrow data from MySQL, PostgreSQL, and SQLite; SQLAlchemy handles ORM, DDL, and writes.
  • Factor computation: calc-flow-python provides time-series, cross-sectional, windowed, and SQL aggregation capabilities.

实测星标增长

24小时
-1
7天
-1
15天
-2
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Alpha-Mind

Alpha-Mind is an Arrow-native framework for multi-factor research and portfolio construction. It connects files, databases, factor computation, risk models, portfolio optimization, execution, and performance analysis in a reproducible research workflow.

Core capabilities

  • Unified data protocol: tables exchanged across modules use pyarrow.Table; pandas is not used as a data interchange layer.
  • File data: Parquet, Arrow IPC, Feather, and CSV are supported; Parquet uses Zstandard compression by default.
  • Database data: ConnectorX reads Arrow data from MySQL, PostgreSQL, and SQLite; SQLAlchemy handles ORM, DDL, and writes.
  • Factor computation: calc-flow-python provides time-series, cross-sectional, windowed, and SQL aggregation capabilities.
  • Trading-calendar tools: dal-python provides trading-day checks, date offsets, and rebalancing schedules.
  • Portfolio optimization: cvxpy supports linear programs, turnover constraints, mean-variance optimization, and target-volatility problems.
  • Research workflows: preprocessing, risk models, quantile analysis, performance attribution, machine learning, execution, and backtesting are included.

Python 3.9 and later are supported; CI covers Python 3.9–3.14.

Quick start

git clone https://github.com/alpha-miner/alpha-mind.git
cd alpha-mind
uv sync --frozen --group dev
uv run python examples/parquet_demo/demo.py

This command requires neither a database nor network data. It generates 20 functional artifacts and one Parquet manifest. See the Introduction and Setup and Parquet demo.

Minimal Arrow example

import datetime as dt
import pyarrow as pa

from alphamind.data import Transformer, read_parquet, write_parquet
from alphamind.formula import CSRank, MA

source = pa.table(
    {
        "trade_date": [dt.date(2026, 1, 5), dt.date(2026, 1, 5)],
        "code": ["000001", "000002"],
        "value": [1.2, 2.4],
    }
)
write_parquet(source, "source.parquet")

transformer = Transformer({"rank": CSRank("value"), "mean_2": MA(2, "value")})
result = transformer.transform("code", read_parquet("source.parquet"))

Time-series and cross-sectional expressions require trade_date and the grouping column code. Transformer results contain only expression outputs; when key columns are needed, reattach them from the sorted input.

Documentation

See the documentation home for the complete directory and the API Reference for the API index.

Development and verification

uv run ruff check .
uv run ruff format --check .
uv run pytest --cov=alphamind --cov-report=term-missing
uv build
uv run alphamind-benchmarks --output benchmark-results

Tests use pytest, and Ruff handles both linting and formatting. The branch-coverage gate is 90%. Real database integration tests are configured through ALPHAMIND_MYSQL_URI and ALPHAMIND_POSTGRES_URI; they are skipped when these variables are not set.

License

MIT

探索相关项目

加载中…