Repository navigation
Balanced Portfolio v1.0.0 #3
hxlog
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Balanced Portfolio v1.0.0
First stable release of an open-source multi-asset risk-parity portfolio platform with CFFEX index-futures analytics and OTC autocallable pricing.
7279a636acbad81ffd1a3cf721c327b84f0c4b2av1.0.0(Semantic Versioning 2.0.0)中文介绍
这是什么(产品)
Balanced Portfolio(均衡组合)是一套面向学习与研究的全栈投资组合管理系统。它以桥水风格的风险平价 / 全天候思想为核心,把宏观场景划分、组合优化、历史回测、机构级可视化,以及国内股指期货结构观察、场外自动敲入敲出(autocallable)结构化产品定价,整合进同一套可自托管的应用中。
本版本 v1.0.0 是项目的首个正式稳定版:公开能力边界、部署路径与主要功能模块相对稳定,适合克隆仓库本地搭建、阅读实现,或在自有环境中做教学与研究实验。在线演示见 xushilu.com;开发心路与产品说明见 博客长文。
主要功能
1. 多资产风险平价组合与回测
按 GDP 增长 / 宏观通胀二分法,将资产映射到四象限(不同宏观环境下占优品种的配置框架),并提供多种优化与风险分配方式,包括:
quadrant_inner_sharpe_outer_rp)all_risk_parity)all_max_sharpe)sharpe_sq_risk_budget)回测结果覆盖:优化权重、净值曲线、调仓记录、风险指标、相关性,以及绩效归因。系统强调无未来函数约束:每个交易日仅使用当日及之前滚动窗口数据;测试会验证「篡改未来收益不得改变历史净值」。
2. 中金所股指期货数据看板
跟踪 IF / IH / IC / IM 及对应指数(沪深 300、上证 50、中证 500、中证 1000),提供同一交易日口径的:
用于观察基差与期限结构,不包含下单或实时成交保证。
3. 场外期权自动敲入敲出(Autocallables)定价
覆盖雪球、凤凰、气囊与障碍等结构;支持蒙特卡洛、BSM 求解、积分法等路径。输出包括公允价值、PV、PoL,以及 Delta / Gamma / Vega / Theta / Rho 等敏感度,并支持存续路径与状态可视化。定价可异步执行并持久化,便于交互式研究。
4. 机构向可视化与工程化
开箱可用的交互仪表盘,把组合回测、期货看板与 OTC 定价放在统一前端;后端提供 OpenAPI(
/docs)、健康检查与可部署架构。技术说明
bp_quote_clean(A 股交易日历对齐、内部缺口线性插值、前导缺口截断、无右端锚点的尾部缺口报错),回测只读清洗行情。BP_TASK_MODE=inline。docs/architecture.md,部署见docs/deployment.md与deploy/OPS.md。快速开始
请参阅仓库 README Quick Start:配置
.env→ 安装依赖 → 执行ddl/schema.sql→python -m bp_ingest run→ 启动uvicorn与前端npm run dev。数据与投资免责声明
AKShare 聚合公开数据接口,数据源可能调整、延迟、限流、修订或停止服务。项目不保证行情、交易日历、复权、基差、波动率、定价结果和回测结果完整、准确或持续可用,使用者应自行核验数据授权、质量和适用性。
本项目仅用于软件开发、教学和研究,不构成投资建议、交易信号、估值意见、要约或任何收益承诺。回测和模型价格不代表未来表现或可成交价格,实盘决策及损失由使用者自行承担。
English
What it is (product)
Balanced Portfolio is an open-source, self-hostable full-stack platform for multi-asset risk-parity / all-weather style portfolio construction and backtesting, plus CFFEX equity-index futures analytics and OTC autocallable structured-product pricing. It is intended for developers, students, and researchers who want a transparent, end-to-end stack—from market ingest and cleaning through optimization, async jobs, and interactive dashboards.
v1.0.0 is the first stable tagged release under Semantic Versioning. Live demo: xushilu.com. Long-form product story: blog post.
Highlights
1. Risk-parity portfolios & backtests
Assets are organized via a growth/inflation four-quadrant macro lens. Supported optimizers / risk budgets include:
Outputs include weights, NAV, rebalances, risk metrics, correlations, and performance attribution. Backtests are designed to be point-in-time: each day uses only data available on or before that day; tests assert that mutating future returns does not change historical NAV.
2. CFFEX index-futures dashboard
Tracks IF, IH, IC, IM and their underlyings with same-trading-day snapshots, term structure, historical annualized basis, and statistical percentiles—for market structure observation, not execution.
3. OTC autocallables pricing
Snowball, phoenix, airbag, and barrier-style products with Monte Carlo and analytical / integral methods where applicable. Reports fair value, PV, PoL, Greeks (Delta, Gamma, Vega, Theta, Rho), and path/status views for interactive study.
4. Production-minded visualization
A unified web UI over FastAPI + Next.js, with OpenAPI docs, health checks, and documented deployment (PostgreSQL 18 + TimescaleDB; optional workers).
Technical notes
docs/architecture.mdanddocs/deployment.mdfor architecture and ops.Getting started
Follow the repository README Quick Start, then open
http://localhost:3000(API health:/api/health, OpenAPI:/docs).Data & investment disclaimer
AKShare aggregates public data interfaces that may change, delay, rate-limit, revise, or stop. This project does not guarantee completeness, accuracy, or ongoing availability of market data, calendars, corporate actions, basis, volatility, pricing, or backtest results. Users must verify data licensing, quality, and fitness for purpose.
This project is for software development, education, and research only. It does not constitute investment advice, trading signals, valuation opinions, offers, or any performance promise. Backtests and model prices do not represent future results or executable prices. Users are solely responsible for real-world decisions and losses.
Assets
Source code archives are provided automatically by GitHub for tag
v1.0.0(zip / tar.gz). No additional binaries are attached to this release.Full changelog
Initial stable release
v1.0.0(first release for this repository). Tagged commit:7279a636acbad81ffd1a3cf721c327b84f0c4b2a.Links
This discussion was created from the release Balanced Portfolio v1.0.0.
All reactions