Files
worldquant-alpha-system/docs/worldquant-knowledge-base/02-ai-mining/python-alpha.md
T
2026-09-07 20:03:16 +08:00

34 lines
4.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Python Alpha:先选对场景,再增加表达力
FastExpr 已能表达的简单机制,先用它建立基线。需要自定义变换、跨步状态或更复杂机器学习逻辑时,再评估 Python 的收益是否值得额外正确性与运行成本。
## 当前取得官方证据的边界
| 能力 | 官方说明 |
| --- | --- |
| 自定义计算 | 可自定义算子、复杂时序、持久状态、机器学习;清洗和公司行为调整责任增加 |
| API | 支持 `brain.simulate()`/`brain.simulate_async()`;Labs 外需 PYTHON 语言与 lookback 设置 |
| multi_sim | 不支持,仅单条 simulation |
| SuperAlpha | Python Alpha 不能作为组件 |
| Power Pool | Python Alpha 不符合参赛资格 |
| Pyramid / Genius signal | 官方分别答复可以计入 |
| 缩短日期范围 | start_date/end_date 仅用于 Labs simulation,不影响真实后台 simulation |
| 起步模板 | Labs 的 quick-start notebook 与 `alpha_example.py` |
来源:[What are the advantages of Python Alphas over Fast Expression Alphas?](https://support.worldquantbrain.com/hc/en-us/articles/41142997585943)(官方,更新 2026-08-30);[Can I run Python Alpha simulations via the API?](https://support.worldquantbrain.com/hc/en-us/articles/41143237730711)(官方,更新 2026-06-27);[Does Python Alpha support multi-simulation (multi_sim)?](https://support.worldquantbrain.com/hc/en-us/articles/41143256748183)(官方,更新 2026-06-27);[Can Python Alphas be selected as components in a SuperAlpha?](https://support.worldquantbrain.com/hc/en-us/articles/41143165313815)(官方,更新 2026-06-27);[Can Python Alphas be submitted in the Power Pool competition?](https://support.worldquantbrain.com/hc/en-us/articles/41143131195671)(官方,更新 2026-07-17);[Can a Python Alpha count toward my pyramid number?](https://support.worldquantbrain.com/hc/en-us/articles/41143114222999)(官方,更新 2026-07-17);[Do Python Alphas count toward my Genius signal count and cap?](https://support.worldquantbrain.com/hc/en-us/articles/41143111825303)(官方,更新 2026-07-17);[Can I simulate Python Alphas over a shorter date range?](https://support.worldquantbrain.com/hc/en-us/articles/41143262103191)(官方,更新 2026-06-12);[Are there any Python Alpha templates or example Alphas to start from?](https://support.worldquantbrain.com/hc/en-us/articles/41143071092119)(官方,更新 2026-06-27)。
## 转写必须做的对照(建议)
- 固定股票顺序、交易日、delay、mask、缺失哨兵、回填方式与 corporate actions 处理;缺失值不能一律填零。
- 区分截面 rank 与时序 rank;检查窗口是否包含当日、初始化多久、历史不足怎样处理。
- 对小样本逐日比较中间数组,再比较最终权重和 PnL;最终 Sharpe 相近不能证明数值等价。
- 行业中性化不等于减去全市场均值,pasteurize/neutralize/scale 的先后需要明确。
- 只有必要时持久化 state;保存状态会影响重启与复现,避免泄漏未来信息。
- 返回 dtype、形状、字段类型支持和 lookback 上限从当前 Labs 示例与实际接口核对,不照搬旧帖数字。
社区两阶段方法先 FastExpr 探测、再 Python 深化,有助于限制搜索成本;作者声称的耗时提升未经本次复现。5 月“lookback≤115”和 8 月“50–350”范围相冲突,因此本库不提供固定上限,也不沿用“不支持 GLB/GROUP/VECTOR”的历史断言。
来源:[[Python Alpha 挑战赛]Python Alpha两阶段筛选法:FastExpr快速验证 + Python深度优化](https://support.worldquantbrain.com/hc/en-us/community/posts/41135490599063)(发帖 2026-06-11,社区经验);[从 Fast 翻译到 Python Alpha 别急着炫技:截面/时序错位是头号杀手,事件漂移和中性化层级是隐形雷](https://support.worldquantbrain.com/hc/en-us/community/posts/42047259261335)(发帖 2026-07-18,社区经验);[【经验分享】Python Alpha 30名心得:从 FastExpr 到 Python,我用 17 个 alpha 趟出来的一条路](https://support.worldquantbrain.com/hc/en-us/community/posts/42519002511767)(发帖 2026-08-06,社区经验);[Python Alpha 平台限制粗略小结,请大佬指正](https://support.worldquantbrain.com/hc/en-us/community/posts/40742727142679)(发帖 2026-05-26,社区经验)。
本次没有安装或运行 BRAIN Labs Python SDK,所以这里只提供官方入口与迁移验证设计,不提供宣称可直接运行的 SDK 脚本。