AI 驱动的 Alpha 因子生成、测试和提交系统。
text
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Web Dashboard │────▶│ Alpha Generator │────▶│ WorldQuant API │
│ (Flask) │ │ (Ollama) │ │ (External) │
│ Port 5000 │ │ Port 11434 │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
└───────────────────────┼───────────────────────┘
▼
┌─────────────────┐
│ Results & │
│ Logs Storage │
└─────────────────┘
bash
# 创建凭据文件
echo '["your.email@worldquant.com", "your_password"]' > credential.txt
bash
# GPU 版本(推荐)
docker-compose -f docker-compose.gpu.yml up -d
# CPU 版本
docker-compose up -d
python
from worldquant_miner import AlphaGenerator
# 初始化
generator = AlphaGenerator(
model="llama3.2:3b",
credential_path="credential.txt"
)
# 生成 Alpha
alpha = generator.generate()
print(alpha)
# 输出:
# rank(ts_corr(close, volume, 20)) * -1
python
from worldquant_miner import AlphaMiner
# 从现有表达式挖掘变体
miner = AlphaMiner(
expression="rank(ts_corr(close, volume, 20))",
params={"window": [10, 20, 30, 60]}
)
# 运行
results = miner.run()
# 测试 4 个变体
python
from worldquant_miner import AlphaSubmitter
submitter = AlphaSubmitter(credential_path="credential.txt")
# 提交成功的 Alpha
submitter.submit_best(
results_dir="results/",
min_sharpe=1.0, # 最低夏普比率
max_correlation=0.7 # 最大相关性
)
指标Kimi API本地 Ollama生成速度10-15s3-5s成本按次收费免费隐私数据上传本地处理可用性依赖网络离线可用
WorldQuant 著名的 101 公式化 Alpha:
python
# Alpha #1
(rank(Ts_ArgMax(SignedPower(((returns < 0) ? stddev(returns, 20) : close), 2.), 5)) - 0.5)
# Alpha #2
(-1 * correlation(rank(delta(log(volume), 2)), rank(((close - open) / open)), 6))
# Alpha #3
(-1 * correlation(rank(open), rank(volume), 10))
完整 101 个 Alpha 见 Alpha101
text
worldquant-miner-cn/
├── SKILL.md
├── README.md
├── scripts/
│ ├── setup.sh # 安装脚本
│ ├── start_gpu.sh # GPU 启动
│ └── start_cpu.sh # CPU 启动
└── references/
└── README_en.md # 原始英文版
版本: 1.0.0 来源: worldquant-miner