Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ An LLM-powered intelligent analysis platform for the A-share (Chinese stock) mar
| 🌊 事件总线 | Redis Streams 事件驱动微 OODA(行情 / 新闻 / 情绪 / 信号) | Event Bus | Redis-Streams event-driven micro-OODA (market / news / sentiment / signal) |
| 🛡️ 风险引擎 | 熔断器 + Kelly 仓位 + VaR + A股约束(T+1 / 涨跌停 / 100 股) | Risk Engine | circuit breaker + Kelly sizing + VaR + A-share constraints (T+1 / price limits / 100-share lots) |
| 🌐 全球情报 + 新闻 | 全球指数 / 大宗 / 汇率关联 + AI 新闻聚合 | Global Intel + News | global indices / commodities / FX correlation + AI news aggregation |
| 📈 量化回测 | backtrader 策略回测,可选 Qlib Alpha158 | Backtesting | backtrader strategy backtesting, optional Qlib Alpha158 |
| 📈 量化回测 | backtrader 策略回测,可选 Qlib 自定义 alpha 因子 | Backtesting | backtrader strategy backtesting, optional Qlib custom alpha factors |
| 📱 Discord | 交易信号 / 情报自动推送到 Discord | Discord | auto-push trade signals / intel to Discord |
| 🖥️ Web UI | FastAPI + React 19:ControlTower / Portfolio / Recommendations / Review | Web UI | FastAPI + React 19: ControlTower / Portfolio / Recommendations / Review |
| ⚙️ 自动化调度 | Celery 45+ 定时任务 + 常驻 agent 守护进程 | Automation | Celery beat (45+ tasks) + always-on agent daemon |
Expand Down Expand Up @@ -88,7 +88,7 @@ src/web/ FastAPI · frontend/ React SPA · src/discord_bot/ · openclaw/ C
| 数据 / Data | AKShare, adata, EastMoney push2 (curl_cffi), QMT/XtQuant (optional), pandas, numpy, pyarrow, yfinance |
| 分析 / Analysis | ta (technical indicators), plotly, matplotlib |
| AI 预测 / AI | Anthropic Claude, Google Gemini, OpenAI, DeepSeek, Claude Code bridge (fallback) |
| 量化 & Agent / Quant | hmmlearn (HMM 市场状态), networkx (知识图谱), scikit-learn, Qlib Alpha158 (optional) |
| 量化 & Agent / Quant | hmmlearn (HMM 市场状态), networkx (知识图谱), scikit-learn, Qlib custom alpha factors (optional) |
| 策略回测 / Backtest | backtrader, Qlib (optional) |
| 后端 / Backend | FastAPI, uvicorn, Redis (cache + Streams 事件总线), Celery + Beat |
| 前端 / Frontend | React 19, TypeScript, Vite, shadcn/ui, Tailwind CSS 4, React Query |
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/development-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ See @requirements.txt for Python dependencies and @frontend/package.json for fro
|-------|-----------------|
| Data | AKShare, adata, EastMoney push2 (curl_cffi), XtQuant (QMT), pandas, numpy, pyarrow, Qlib (optional) |
| Intelligence | NetworkX (knowledge graph), feedparser, ddgs/searxng |
| Quant / Agent | hmmlearn (HMM regime), scikit-learn, Qlib Alpha158 (optional) |
| Quant / Agent | hmmlearn (HMM regime), scikit-learn, Qlib custom alpha factors (optional) |
| Prediction / LLM | Anthropic Claude, Google Gemini, OpenAI, DeepSeek, Claude Code bridge |
| Strategy | backtrader |
| Web Backend | FastAPI, uvicorn, Redis (cache + Streams event bus) |
Expand Down
7 changes: 6 additions & 1 deletion scripts/qlib_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ def cmd_predict(symbols: list[str], horizon: int) -> dict[str, dict[str, Any]]:
# Use mean recent return as raw score, sigmoid to [0,1]
raw = float(returns.mean()) * 100 # scale up
score = round(1.0 / (1.0 + math.exp(-raw)), 4)
# IC: autocorrelation of returns as proxy
# NOTE: serial autocorrelation of returns, used as a rough
# proxy only — this is NOT a true cross-sectional Information
# Coefficient (rank-corr of factor vs forward returns).
if len(returns) >= 10:
ic = round(float(returns.autocorr()), 4)

Expand Down Expand Up @@ -278,6 +280,9 @@ def cmd_ic(symbol: str) -> dict[str, Any]:
if data is None or data.empty or len(data) < 10:
return {"symbol": symbol, "ic": None, "reason": "insufficient data"}

# Serial return autocorrelation used as a rough proxy — NOT a true
# cross-sectional Information Coefficient. The "ic" key is kept for
# config/back-compat; treat it as an autocorrelation signal.
ic_val = float(data.iloc[:, 0].dropna().autocorr())
threshold = _ACTUARY_CFG.get("ic_threshold", 0.03)
return {
Expand Down
6 changes: 4 additions & 2 deletions src/intelligence/impact_chain.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""Impact Chain Engine — builds event-to-asset transmission chains.

Per PRD v34.0 FR-GI002: Automatic construction of causal chains from
macro events to affected sectors and stocks.
Per PRD v34.0 FR-GI002: maps macro events to affected sectors and stocks using
hand-authored, keyword-matched transmission **templates** (a curated rule base).
These are domain-knowledge templates, NOT statistically inferred causality — the
edge confidences are fixed constants, not estimated from data.

Example chain:
中东战争 → 原油↑ → 航运成本↑ → 航运股↓
Expand Down
8 changes: 5 additions & 3 deletions src/quant/qlib_alpha.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""Qlib Alpha factor computation — enhanced factor library for stock screening.
"""Qlib alpha factor computation — custom factor library for stock screening.

FR-QL001: Wraps Qlib-style Alpha158 factor categories into a computation
engine that works via the QlibAdapter (remote/subprocess/in-process).
FR-QL001: a hand-written set of ~20 alpha factors expressed in the Qlib DSL,
computed via the QlibAdapter (remote/subprocess/in-process). This is *inspired
by* Qlib's Alpha158 factor categories but is NOT Qlib's Alpha158 dataset handler
— it does not instantiate or reproduce the full 158-factor set.

Factor categories:
- Momentum: 5d, 10d, 20d, 60d price momentum
Expand Down
Loading