QuantGPT
Agent-driven alpha factory โ LLM autonomously designs, backtests, and submits factors to WorldQuant BRAIN
Ask AI about QuantGPT
Powered by Claude ยท Grounded in docs
I know everything about QuantGPT. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
QuantGPT
Agent-Driven LLM Quant Research Engine โ Autonomous Factor Mining at WorldQuant BRAIN Submission Quality
LLM Agent ่ชๆฒปๅ ๅญๆ็ฟ โ ๆน้ๅๆต โ ๅค็ปด่ฏๅ โ ๅ่ฟๆๅ้ช่ฏ โ WQ BRAIN ่ชๅจๆไบค | ๅ จ็จ้ถไบบๅทฅๅนฒ้ข
Quick Start ยท Architecture ยท API Docs ยท MCP Guide ยท Factor Mining ยท Contributing
What Is QuantGPT
QuantGPT is an agent-driven factor research engine โ not a backtest library, not a chatbot wrapper. It gives an LLM Agent (Claude, via MCP) a complete toolkit to autonomously discover, evaluate, iterate, and submit alpha factors to WorldQuant BRAIN, with zero human intervention per research cycle.
The core architecture:
LLM Agent (Claude Code / Claude Desktop)
โ
โโโ MCP Tools (14 ไธช) โ Agent ็ๅทฅๅ
ท็ฎฑ
โ โโโ run_backtest โ ๅ
จๅธๅบๅ็ปๅๆต
โ โโโ score_factor โ 0-100 ็ปผๅ่ฏๅ
โ โโโ diagnose_factor โ ๅคฑ่ดฅๆจกๅผ่ฏๆญ
โ โโโ run_anti_overfit โ 4 ้กนๅ่ฟๆๅๆฃ้ช
โ โโโ run_rolling_validation โ Walk-forward ้ช่ฏ
โ โโโ validate_expression โ ่ฏญๆณๆ ก้ช
โ โโโ list_operators โ 50+ ็ฎๅญๆๆกฃ
โ โโโ list_universes โ ่ก็ฅจๆฑ ๅๅบๅ
โ โโโ wq_brain_submit โ WQ BRAIN ๅๅ ๅญๆไบค
โ โโโ wq_brain_batch_submit โ ๆน้ๅๆฐๆซๆๆไบค
โ โโโ wq_brain_submit_by_ids โ ๆ ID ๆไบค
โ โโโ wq_brain_list_alphas โ ๆฅ่ฏขๅทฒๆไบค alpha
โ โโโ wq_brain_check_alphas โ ๆฃๆฅ alpha ็ถๆ
โ โโโ wq_brain_finalize_submissions โ ๆ็ปๆไบค็กฎ่ฎค
โ
โโโ Evolution Engine โ ๅ ๅญ่ฟๅๅผๆ
โ โโโ MutationEngine (8 ๆนๅ็ชๅ)
โ โโโ CrossoverEngine (้ซๅๅ ๅญไบคๅ)
โ โโโ MetaEvolutionSelector (่ช้ๅบ็ญ็ฅ)
โ โโโ TrajectoryAnalyzer (่ฝจ่ฟนๅๆ)
โ
โโโ WQ BRAIN Integration โ WorldQuant ็ด่ฟ
โ โโโ Dollar-neutral ๆจกๆ
โ โโโ IS ๆฃๆตๅฏน้ฝ
โ โโโ Fitness ่ฏๅ
โ โโโ ไธ้ฎๆญฃๅผๆไบค
โ
โโโ Knowledge Base โ ่ทจไผ่ฏ็ฅ่ฏ็งฏ็ดฏ
โโโ rules/ (ๅทฒ้ช่ฏ่งๅ)
โโโ findings/ (็ป้ชๅ็ฐ)
โโโ failures/ (ๅทฒ่ฏไผช่ทฏๅพ)
How It Differs from "AI Backtest Tools"
ไผ ็ปๅทฅๅ ท๏ผๅ ๆฌ ChatGPT + ๅๆตๅบ๏ผ็ๆจกๅผๆฏ๏ผไบบ็ฑปๆณๅ ๅญ โ ๅทฅๅ ท่ทๅๆต โ ไบบ็ฑป็็ปๆใAgent ๆฏๆง่ก่ ๏ผไบบ็ฑปๆฏๅณ็ญ่ ใ
QuantGPT ็ๆจกๅผๆฏ๏ผไบบ็ฑปๅฎไน็ฎๆ โ Agent ่ชๆฒป็ ็ฉถ โ ไบบ็ฑปๅฎก้ ไบงๅบใAgent ๆฏ็ ็ฉถ่ ๏ผไบบ็ฑปๆฏๅฎก้ ่ ใ
่ฟไธๆฏๆฅๅฃๅฑ็ๅบๅซ๏ผ่ช็ถ่ฏญ่จ vs. ไปฃ็ ๏ผ๏ผ่ๆฏๅณ็ญๆ็ๅบๅซใAgent ่ชไธปๅณๅฎ๏ผๆข็ดขๅชไธชๆนๅใ็ๆไปไน่กจ่พพๅผใ่ฏไผฐๅชไบๆๆ ใไฝๆถ่ฟญไปฃใไฝๆถๆพๅผใไฝๆถๆไบคใ
Production Track Record
| Metric | Value |
|---|---|
| ็ดฏ่ฎกๅๆตไปปๅก | 370+ |
| ๅ่ฝฎ่ฟญไปฃ๏ผ8 ๅ้ๅ ๅญ๏ผ | ~15 ๅ้ |
| ่กจ่พพๅผ็ฎๅญๆ ๅ | WorldQuant BRAIN ๅฏน้ฝ |
| BRAIN ๆญฃๅผๆไบค | 3 ไธชๅ ๅญ IS ๅ จ้จ PASS๏ผๅทฒๆไบค๏ผๆไฝณ Fitness 1.26๏ผ |
| WQ BRAIN ้ๆ | ๅ ็ฝฎ API โ ไธ้ฎๆจกๆ + ่ชๅจๆไบค |
Validated Results โ Factors Submitted to BRAIN
QuantGPT Agent ๅทฒไบงๅบ 3 ไธชๆญฃๅผๆไบคๅ ๅญ๏ผๅ จ้จ้่ฟ WQ BRAIN IS ๆฃๆต๏ผ
| Factor | Expression | WQ Sharpe | WQ Fitness | WQ Returns | IS Tests | Status |
|---|---|---|---|---|---|---|
| Debt-Momentum Composite | -1 * rank(ts_av_diff(close, 10)) + rank(debt / enterprise_value) | 1.77 | 1.26 | 20.18% | ALL PASS | Submitted |
| VWAP Decay Reversal | -1 * rank(ts_decay_linear(close / vwap, 10)) | 1.69 | 1.07 | 18.63% | ALL PASS | Submitted |
| Returns-Volume Momentum | -1 * rank(ts_decay_linear(returns * volume / adv20, 5)) | 1.60 | 1.03 | 24.15% | ALL PASS | Submitted |
3 ไธชๅ ๅญไปฃ่กจไธๅ็ alpha ๆฅๆบ๏ผDebt-Momentum ็ปๅๅจ้ๅ่ฝฌไธๅบๆฌ้ข๏ผๅบๅก/ไผไธไปทๅผ๏ผ๏ผ่กไธไธญๆงๅ๏ผVWAP Decay Reversal ๆๆไปทๆ ผๅ็ฆป VWAP ็่กฐๅๅๅฝ๏ผๅธๅบไธญๆงๅ๏ผReturns-Volume Momentum ๆๆๆถ็็ไธ็ธๅฏนๆไบค้็่กฐๅๅจ้๏ผๅธๅบไธญๆงๅใๅ จ็จ Agent ่ชๆฒปๅฎๆใ
Debt-Momentum Composite โ ๅทฒๆญฃๅผๆไบค๏ผSharpe 1.77, Fitness 1.26, Returns 20.18%, IS ๅ จ้จ PASS
VWAP Decay Reversal โ ๅทฒๆญฃๅผๆไบค๏ผSharpe 1.69, Fitness 1.07, Returns 18.63%, IS ๅ จ้จ PASS
Returns-Volume Momentum โ ๅทฒๆญฃๅผๆไบค๏ผSharpe 1.60, Fitness 1.03, Returns 24.15%, IS ๅ จ้จ PASS
Autonomous Factor Mining โ The Core Loop
This is QuantGPT's defining capability.
Agent ่ฏป็ฅ่ฏๅบใ่ฎพ่ฎกๅ่ฎพใๆน้ๅฎ้ชใๅๆ็ปๆใ็งฏ็ดฏ็ฅ่ฏใ่ชๆ่ฟญไปฃ๏ผๆฏไธช็ป่ฎบ็ป่ฟๅๆจกๅไบคๅ้ช่ฏใไธไธช็ ็ฉถๅพช็ฏไบงๅบ็ป่ฟ้ช่ฏ็ใๅฏๆไบค WQ BRAIN ็ๅ ๅญใ
Research Cycle
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Research Notes & Knowledge โ
โ (Rules / Findings / Fails) โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโ
โ read
โผ
โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Phase 0 โโโโโถโ Phase 1: Factor Design โโโโโถโ Phase 2: Batch โ
โ Context โ โ Hypothesis โ Expression โ โ Backtest (10-20 โ
โ Loading โ โ 1-3 candidates per idea โ โ concurrent) โ
โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Phase 3: Four-Step Analysis โ
โ โ
โ โ Fact Collection (metrics vs baseline) โ
โ โก Independent Judgment (Agent) โ
โ โข Cross-Review (DeepSeek Reasoner) โ
โ โฃ Consensus or Divergence Resolution โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Phase 4: Update โ โ Phase 5: Stop? โ
โ Notes + Knowledgeโ โ Converged / โ
โ Base โโโโโโโโโโโ Time / Rounds โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ โ no
โ โโโโถ back to Phase 1
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Phase 6: Report โ
โ A/B factors + โ
โ new knowledge โ
โโโโโโโโโโโโโโโโโโโโ
Key Mechanisms
|
Dual-LLM Cross-Review ๆฏไธช็ป่ฎบๆงๅคๆญ๏ผ้็จ/ไธ้็จ/ๅ ณ้ญๆนๅ๏ผๅฟ ้กป็ป่ฟ็ฌฌไบไธช LLM ็ฌ็ซ่ฏๅฎกใๆไบๅฎๆฐๆฎๅ็ฌฌไธไธชๆจกๅ็ๆจ็้พไธ่ตทๅ็ป DeepSeek Reasoner๏ผ่ฆๆฑ็ฌ็ซ่ฏไผฐๆจ็ๆฏๅฆๅ็ใๆฏๅฆๆ้ๆผ่งๅบฆใ ๅ ฑ่ฏ โ ็ดๆฅ่พๅบใๅๆญง โ ๅ็ฐๅๆน่ฏๆฎ๏ผ้็จๆดไฟๅฎ็ป่ฎบใ ่ฟ่งฃๅณไบๅๆจกๅๅ ๅญ็ ็ฉถ็ๆ ธๅฟ้ฎ้ข๏ผconfirmation biasใ |
Persistent Knowledge Base
็ฅ่ฏๅบ่ทจไผ่ฏ็งฏ็ดฏใ็ฌฌ 10 ๆฌก็ ็ฉถไผ่ฏๅฏไปฅ็ดๆฅๅฉ็จๅ 9 ๆฌก็ๆๆๅ็ฐ๏ผ้ฟๅ ้ๅคๅฎ้ช๏ผ้ตๅฎๅทฒ้ช่ฏ่งๅ๏ผ็ปๅผๅทฒ่ฏไผช่ทฏๅพใ ่ฟไธๆฏ chat historyโโๆฏ็ปๆๅ็็ ็ฉถ่ตไบงใ |
|
Batch Concurrent Evaluation ๅๆฌกๆไบค 10-20 ไธชๅ ๅญ่กจ่พพๅผ๏ผๅนถๅๅๆต + ไธๆณข้่ฏใ็ปๆๆ fitness ้ๅบๆๅใhs300 fitness < 0.1 ๆถ่ชๅจ่ทณ่ฟ csi500 ้ช่ฏ๏ผ่็็ฎๅใ
|
Research Discipline (Enforced) ไธๆฏๅปบ่ฎฎ๏ผๆฏ็กฌๆง่งๅ๏ผ
|
ไธ้ข Validated Results ไธญ็ๅ ๅญๅฐฑๆฏ่ฟไธชๆต็จ็ไบงๅบใ ๅค่ฝฎ่ฟญไปฃ๏ผ3 ไธชๅ ๅญๆญฃๅผๆไบค WQ BRAIN๏ผIS ๅ จ้จ้่ฟ๏ผใๅฎๆดๆนๆณ่ฎบ่ง Factor Mining Guideใ
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ QuantGPT Research Engine โ
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ Core Engine โ โ
โ Agent โ โโโโโโโโโโโโโโโโโโโโโโโโ โ Data Layer โ
โ Interface โ โ Expression Parser โ โ โโโโโโโโโโโโโโโโโโโ โ
โ โ โ 50+ operators โ โ โ baostock (free) โ โ
โ MCP Tools โ โ WQ BRAIN compatible โ โ โ akshare (free) โ โ
โ REST API โ โโโโโโโโโโโโฌโโโโโโโโโโโโ โ โ PolarDB (opt) โ โ
โ Web UI โ โโโโโโโโโโโโผโโโโโโโโโโโโ โ โ Parquet cache โ โ
โ (monitor) โ โ Backtest Engine โ โ โโโโโโโโโโโโโโโโโโโ โ
โ โ โ Rank-based grouping โ โ โ
โ โ โ WQ BRAIN aligned โ โ AI Layer โ
โ โ โโโโโโโโโโโโฌโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโ โ
โ โ โโโโโโโโโโโโผโโโโโโโโโโโโ โ โ DeepSeek LLM โ โ
โ โ โ Validation Suite โ โ โ Factor design โ โ
โ โ โ Anti-overfit (4x) โ โ โ Cross-review โ โ
โ โ โ Walk-forward โ โ โ Mutation engine โ โ
โ โ โ WQ BRAIN simulation โ โ โโโโโโโโโโโโโโโโโโโ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ Storage โ
โ โ Evolution Engine โ โโโโโโโโโโโโโโโโโโโ โ
โ โ Trajectory โ Meta-Evo โ โ โ SQLite (default)โ โ
โ โ Mutation / Crossover โ โ PostgreSQL (opt)โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโค
โ Agent Orchestrator: Claude Code skill loop / Claude Desktop MCP โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Tech Stack
| Layer | Technology |
|---|---|
| Agent | Claude Code (skill loop) / Claude Desktop (MCP) |
| Backend | Python 3.10+, FastAPI, uvicorn, SQLAlchemy 2.0 async |
| Database | SQLite (default, zero-config) / PostgreSQL (optional) |
| AI/LLM | DeepSeek (factor generation + cross-review) |
| Market Data | baostock + akshare (free) โ Parquet cache |
| Frontend | React 18 + TypeScript + Tailwind CSS 4 (monitoring dashboard) |
| MCP | FastMCP (stdio / SSE / streamable-http) |
| Report | QuantStats HTML |
Key Engineering Decisions
1. Expression Parser โ The Core Differentiator
่ช็ ็่กจ่พพๅผ่งฃๆๅจ๏ผexpression_parser.py, 870+ lines๏ผๆฏๆดไธช็ณป็ป็ๆ ธๅฟ๏ผ
- 50+ ็ฎๅญ๏ผๆช้ข๏ผ
rank,zscore๏ผใๆถๅบ๏ผts_corr,decay_linear๏ผใ้็บฟๆง๏ผsign_power๏ผใๆกไปถ๏ผwhere,trade_when๏ผใๆๆฏๆๆ ๏ผrsi,macd,atr๏ผ - ๅๆจกๅผ๏ผ
mode="wq"ไป ๅ ่ฎธ WQ BRAIN ๅ ผๅฎน็ฎๅญ๏ผๆไบคๅๆ ก้ช๏ผ๏ผmode="local"ๅผๆพๅ จ้จ็ฎๅญ - ่ฏญไนๆญฃ็กฎ็ๆช้ข/ๆถๅบๅ็ฆป๏ผ
rank()ๆtrade_dateๅ็ป๏ผๆช้ข๏ผ๏ผts_mean()ๆstock_codeๅ็ป๏ผๆถๅบ๏ผ๏ผ่ชๅจๅค็ๅ็ป้ป่พ - ๅฎๅ จ็บฆๆ๏ผ้ๅฝๆทฑๅบฆ้ๅถใ็ชๅฃไธ้ใ่กจ่พพๅผ้ฟๅบฆ้ๅถ๏ผ้ฒๆญขๆถๆ่พๅ ฅ
2. Three-Layer Anti-Overfit System
| Layer | Module | Method |
|---|---|---|
| Statistical Tests | anti_overfit.py | IC ็จณๅฎๆง + ๅญๆ ทๆฌๅๅๆต่ฏ๏ผ็/็/้่ก๏ผ+ ๅฎๆ ฐๅๆฃ้ช + ๅ่กฐๆไผฐ่ฎก |
| Walk-Forward | rolling_validator.py | ๆปๅจ train/valid/test ็ชๅฃ๏ผ่ฏไผฐๆ ทๆฌๅค IC ่กฐๅ |
| WQ Simulation | wq_simulate.py | Dollar-neutral ๅค็ฉบๆจกๆ๏ผๅฏน้ฝ BRAIN ็ Sharpe/Turnover/Fitness ่ฎก็ฎ |
| WQ BRAIN API | wq_brain_client.py | ็ด่ฟ BRAIN ๅนณๅฐ โ ็ๅฎๆจกๆ + IS ๆฃๆต + ไธ้ฎๆญฃๅผๆไบค |
3. Evolutionary Factor Iteration
ๅ QuantaAlpha ๅฏๅ็ไธ้ถๆฎต่ชๅจๆ็ดข๏ผ
TrajectoryAnalyzer โ MetaEvolutionSelector โ Strategy Execution
(่ดจ้ๆๆ ่ฏไผฐ) (EXPLOIT/EXPLORE/ (MutationEngine ร8 ๆนๅ
RECOMBINE/SIMPLIFY) / CrossoverEngine)
8 ็งๅฎๅ็ชๅ๏ผๆถ้ด็ชๅฃๅๅผใ็ฎๅญๆฟๆขใๅคๆๅบฆ่ฐๆดใๆช้ขๅๆขๅ ๅ ็ญใ5 ็ปด่ฏๅ้ฉฑๅจ่ฟญไปฃๆนๅใ
4. Agent-First Access Model
| Mode | Role | Use Case |
|---|---|---|
| MCP (primary) | Agent toolkit | Claude Code / Claude Desktop ้่ฟ MCP ่ฐ็จๆๆ็ ็ฉถๅทฅๅ ท๏ผ้ฉฑๅจ่ชๆฒป็ ็ฉถๅพช็ฏ |
| REST API | Programmatic access | ๆน้ๅๆตใๅค้จ็ณป็ป้ๆใCI/CD ๅ ๅญ้ช่ฏ |
| Web UI | Monitoring dashboard | ไปปๅก็ๆงใๆฅๅๆฅ็ใๅ ๅญๅบ็ฎก็ |
MCP Tools (8 ไธช)
| Tool | Description |
|---|---|
list_operators | ๅ จ้จ็ฎๅญๆๆกฃ |
list_universes | ่ก็ฅจๆฑ ๅๅบๅ |
validate_expression | ่ฏญๆณๆ ก้ช |
run_backtest | ๅฎๆดๅๆต |
score_factor | ่ฏๅ๏ผ0โ100, A/B/C/D๏ผ |
diagnose_factor | ๅคฑ่ดฅๆจกๅผ่ฏๆญ + ๆน่ฟๅปบ่ฎฎ |
run_anti_overfit | 4 ้กนๅ่ฟๆๅๆฃ้ช |
run_rolling_validation | Walk-forward ้ช่ฏ |
Competitive Landscape
| Capability | JoinQuant | Backtrader | ChatGPT + Backtest | QuantGPT |
|---|---|---|---|---|
| Research mode | Human writes code | Human writes code | Human prompts, tool executes | Agent autonomously researches |
| Factor discovery | Manual | Manual | One-shot LLM | Multi-round evolution + knowledge base |
| Anti-bias | Researcher judgment | None | None | Dual-LLM mandatory cross-review |
| Knowledge accumulation | Personal notes | None | Lost between sessions | Structured KB across sessions |
| WQ BRAIN integration | -- | -- | -- | Operator-aligned + direct submission |
| Anti-overfit | -- | -- | -- | 4 statistical tests + walk-forward |
| MCP / AI Agent | -- | -- | -- | 14 tools, skill-loop orchestration |
| Live trading | Yes | Limited | -- | -- |
| Intraday data | Yes | Yes | -- | Daily only |
Quick Start
Option 1: Agent Mode (Recommended)
git clone https://github.com/Miasyster/QuantGPT.git && cd QuantGPT
make setup # creates venv, installs deps, generates .env
make run # starts server at http://localhost:8003
Add MCP configuration to Claude Code or Claude Desktop:
{
"mcpServers": {
"quantgpt": {
"command": "python",
"args": ["-m", "quantgpt"]
}
}
}
Then let the Agent work: "ๅจๆฒชๆทฑ300ไธๆๆ้ซ fitness ็ๅ ๅญ๏ผ็ฎๆ WQ BRAIN ๅฏๆไบค"
Option 2: Expression Mode (No LLM Required)
# Direct expression backtest via API
curl -X POST http://localhost:8003/api/v1/auto_backtest \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{"expression": "rank(close / ts_mean(close, 20))", "universe": "hs300"}'
Windows Quick Start
Windows ็จๆทไธ้่ฆ make ๅ restart.sh๏ผๆๅจๆง่กๅณๅฏ๏ผ
# 1. ๅ
้้กน็ฎ
git clone https://github.com/Miasyster/QuantGPT.git
cd QuantGPT
# 2. ๅๅปบ่ๆ็ฏๅขๅนถๅฎ่ฃ
ไพ่ต
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
# 3. ๆๅปบๅ็ซฏ๏ผ้่ฆ Node.js๏ผไป nodejs.org ไธ่ฝฝ LTS ็ๆฌ๏ผ
cd frontend && npm install && npm run build && cd ..
# 4. ๅฏๅจๆๅก
python -m quantgpt --transport http
# ๆต่งๅจๆๅผ http://localhost:8003
ๆณจๆ๏ผ
- ๆจ่ Python 3.11 ๆ 3.12๏ผ3.14 ๅคชๆฐ๏ผ้จๅไพ่ตๅฏ่ฝไธๅ ผๅฎน๏ผ
- ๅฆๆ็ซฏๅฃ่ขซๅ ็จ๏ผ
netstat -ano | findstr :8003ๆฅ่ฟ็จ๏ผtaskkill /PID <pid> /Fๆๆ- ไนๅฏไปฅไฝฟ็จ WSL2๏ผ
wsl --install๏ผ๏ผไฝ้ชไธ macOS/Linux ๅฎๅ จไธ่ด
Zero config by default: SQLite database, baostock + akshare free data. See full Quick Start guide for details.
Optional: DeepSeek API (for factor generation & cross-review)
# Edit .env, add your DeepSeek API key (~$0.001 per query)
DEEPSEEK_API_KEY=sk-your-key-here
Optional: PostgreSQL (for production)
pip install "quantgpt[postgresql]"
# Edit .env:
DATABASE_URL=postgresql+asyncpg://quantgpt:password@localhost:5432/quantgpt
alembic upgrade head
Expression Examples
# Debt-momentum composite โ BRAIN submitted, Fitness 1.26, Sharpe 1.77
-1 * rank(ts_av_diff(close, 10)) + rank(debt / enterprise_value)
# VWAP decay reversal โ BRAIN submitted, Fitness 1.07, Sharpe 1.69
-1 * rank(ts_decay_linear(close / vwap, 10))
# Returns-volume momentum โ BRAIN submitted, Fitness 1.03, Sharpe 1.60
-1 * rank(ts_decay_linear(returns * volume / adv20, 5))
# 20-day momentum
rank(close / ts_mean(close, 20))
# Low volatility
rank(-1 * ts_std(close/ts_shift(close,1)-1, 20))
# Decay-weighted correlation
decay_linear(rank(ts_corr(vwap, volume, 10)), 5)
Project Structure
quantgpt/
โโโ quantgpt/ # Backend (Python)
โ โโโ expression_parser.py # Factor expression parser (50+ ops, WQ compatible)
โ โโโ backtest.py # Rank-based group backtest engine
โ โโโ market_data.py # baostock/akshare โ Parquet cache
โ โโโ api_server.py # FastAPI REST API + SSE
โ โโโ mcp_server.py # FastMCP server (14 tools โ Agent's toolkit)
โ โโโ iteration.py # 3-phase evolutionary iteration
โ โโโ mutation_engine.py # 8 directed mutation strategies
โ โโโ crossover_engine.py # High-score factor crossover
โ โโโ meta_evolution.py # Adaptive strategy selector
โ โโโ trajectory_analyzer.py # Trajectory quality metrics
โ โโโ anti_overfit.py # 4 statistical anti-overfit tests
โ โโโ rolling_validator.py # Walk-forward validation
โ โโโ wq_simulate.py # WQ BRAIN dollar-neutral simulator
โ โโโ wq_brain_client.py # WQ BRAIN API integration
โ โโโ neutralize.py # Industry & cap neutralization
โ โโโ daily_summary.py # LLM-powered daily market report
โ โโโ routes/ # API route modules
โโโ frontend/ # React 18 + TypeScript + Tailwind CSS 4
โ โโโ src/components/ # Monitoring dashboard
โโโ scripts/
โ โโโ factor_miner.py # Batch factor evaluation toolkit
โโโ tests/ # 74 tests (parser + backtest + WQ simulate)
โโโ example_factor/ # BRAIN validation screenshots
โโโ docs/ # Architecture, API, MCP, Mining guides
Limitations
- Daily frequency only โ no intraday backtesting
- A-share market only โ China mainland equities
- Agent quality depends on LLM โ better models produce better factors
License
MIT โ Copyright (c) 2026 Miasyster
This repository is the original source of the QuantGPT factor research engine. Derivative works should retain the copyright notice and comply with the MIT License terms. See NOTICE for details.
Past factor performance does not guarantee future returns. This project does not constitute investment advice.
