一键导入
alpha-monitor
Factor monitoring. Check active factors for IC decay and health issues. 因子监控。检查活跃因子的IC衰减和健康状态。 Triggers: "health check", "monitor", "检查因子健康", "因子状态"
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Factor monitoring. Check active factors for IC decay and health issues. 因子监控。检查活跃因子的IC衰减和健康状态。 Triggers: "health check", "monitor", "检查因子健康", "因子状态"
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Autonomous factor research loop. Auto-mine, evaluate, register, monitor, and retire factors. 自动化因子研究闭环。自动挖掘、评估、注册、监控和退役因子。 Triggers: "run autopilot", "autonomous mode", "自动驾驶", "自动挖掘并监控", "alpha-autopilot"
Daily trading signal generator. Compute factor scores on latest data and output target portfolio. 每日交易信号生成器。基于最新数据计算因子得分,输出目标持仓。 Triggers: "generate signals", "today's trades", "生成信号", "今日信号", "alpha-signal"
Automated factor mining. Systematically generate, screen, and evaluate candidate factors. 自动因子挖掘。系统性生成、筛选和评估候选因子。 Triggers: "mine factors", "auto discover", "挖掘因子", "自动挖掘", "alpha-mine"
Strategy backtest. Single/multi-factor portfolio backtesting with gate checks. 策略回测。单/多因子组合回测。 Triggers: "backtest", "run backtest", "回测", "跑个回测"
Factor discovery. Design factors from natural language descriptions. 因子发现。根据自然语言描述设计因子。 Triggers: "design a factor", "find a factor", "帮我找一个因子", "设计因子"
Factor evaluation. Multi-level evaluation pipeline (IC/ICIR/quintile/robustness). 因子评估。多级评估管线(IC/ICIR/分层/多空/鲁棒性)。 Triggers: "evaluate factor", "test factor", "评估因子", "测试因子"
| name | alpha-monitor |
| description | Factor monitoring. Check active factors for IC decay and health issues. 因子监控。检查活跃因子的IC衰减和健康状态。 Triggers: "health check", "monitor", "检查因子健康", "因子状态" |
你是一个因子监控系统。检查因子库中所有活跃因子的当前健康状态。 You are a factor monitoring system. Check health status of all active factors in the library.
| English | 中文 |
|---|---|
| Factor | 因子 |
| IC (Information Coefficient) | 信息系数 |
| ICIR (IC Information Ratio) | IC信息比率 |
| Quintile | 五分位/分组 |
| Long-Short | 多空 |
| Sharpe Ratio | 夏普比率 |
| Max Drawdown | 最大回撤 |
| Monotonicity | 单调性 |
| Robustness | 鲁棒性 |
| Holding Period | 持有期 |
| Factor Registry | 因子注册表 |
| Backtest | 回测 |
| Gate Check | 门控检查 |
Multi-Market Support / 多市场支持:
Alpha Skills support A-share (default), HK, and US stocks via data adapters: Alpha Skills 通过数据适配器支持A股(默认)、港股和美股:
# .claude/alpha-agent.config.md
MARKET: A-share # or "HK" or "US"
DATA_MODULE: (leave empty for A-share Tushare default)
# or "examples.us_data_yfinance"
# or "examples.hk_data_yfinance"
When a custom DATA_MODULE is set, the skill loads MARKET_CONFIG from that module to determine benchmark, cost rate, and trading rules. 设置自定义DATA_MODULE时,skill从该模块加载MARKET_CONFIG来确定基准、成本和交易规则。
Language Rule / 语言规则:
import sys, os, sqlite3, json, uuid
from datetime import datetime
PROJECT_DIR = '<当前工作目录 current working directory>'
# ── 因子注册表(自包含,无外部依赖)/ Factor Registry (self-contained, no external deps) ──
class FactorRegistry:
def __init__(self, db_path="alpha_skills.db"):
self.db_path = db_path
with sqlite3.connect(db_path) as conn:
conn.execute("""CREATE TABLE IF NOT EXISTS factors (
id TEXT PRIMARY KEY, name TEXT UNIQUE NOT NULL,
expression TEXT NOT NULL, category TEXT, description TEXT,
status TEXT DEFAULT 'active', market TEXT DEFAULT 'A-share',
ic_mean REAL, icir REAL, best_holding_period INTEGER,
quality TEXT, eval_date TEXT,
created_at TEXT DEFAULT CURRENT_TIMESTAMP, metadata TEXT)""")
def register(self, name, expression, **kwargs):
fid = str(uuid.uuid4())[:8]
with sqlite3.connect(self.db_path) as conn:
conn.execute(
"INSERT OR REPLACE INTO factors (id,name,expression,category,description,status,market,ic_mean,icir,best_holding_period,quality,eval_date,metadata) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)",
(fid, name, expression, kwargs.get("category",""), kwargs.get("description",""),
"active", kwargs.get("market","A-share"), kwargs.get("ic_mean"), kwargs.get("icir"),
kwargs.get("best_holding_period"), kwargs.get("quality"),
datetime.now().isoformat(), json.dumps(kwargs.get("metadata",{}))))
return fid
def list_all(self, status=None):
with sqlite3.connect(self.db_path) as conn:
conn.row_factory = sqlite3.Row
if status:
rows = conn.execute("SELECT * FROM factors WHERE status=? ORDER BY icir DESC", (status,)).fetchall()
else:
rows = conn.execute("SELECT * FROM factors ORDER BY icir DESC").fetchall()
return [dict(r) for r in rows]
def get(self, name):
with sqlite3.connect(self.db_path) as conn:
conn.row_factory = sqlite3.Row
row = conn.execute("SELECT * FROM factors WHERE name=?", (name,)).fetchone()
return dict(row) if row else None
def update_status(self, name, status):
with sqlite3.connect(self.db_path) as conn:
conn.execute("UPDATE factors SET status=? WHERE name=?", (status, name))
def delete(self, name):
with sqlite3.connect(self.db_path) as conn:
conn.execute("DELETE FROM factors WHERE name=?", (name,))
reg = FactorRegistry(os.path.join(PROJECT_DIR, "alpha_skills.db"))
active_factors = reg.list_all(status='active')
如果因子库为空,提示用户先注册因子。 If library is empty, prompt user to register factors first.
加载最近1年的数据用于计算滚动指标(同alpha-evaluate的数据加载流程)。 Load last 1 year of data for rolling metrics (same as alpha-evaluate data loading pipeline).
对每个因子 / For each factor:
🟢 HEALTHY: Rolling ICIR 滚动ICIR ≥ Registered ICIR 注册ICIR × 50%
🟡 WARNING: Rolling ICIR 滚动ICIR < Registered ICIR 注册ICIR × 50% or 或 2 consecutive months IC negative 连续2月IC为负
🔴 ALERT: Rolling ICIR 滚动ICIR < 0 or 或 4 consecutive months IC negative 连续4月IC为负 or 或 quintile monotonicity collapse 分组单调性崩溃
分析可能的原因 Analyze possible causes:
给出建议 Provide suggestions:
🏥 Factor Health Report / 因子健康报告 (YYYY-MM-DD)
🟢 pv_diverge Rolling ICIR 滚动ICIR=0.62 (Registered 注册 0.70) Healthy 健康
🟢 turnover_20 Rolling ICIR 滚动ICIR=0.48 (Registered 注册 0.52) Healthy 健康
🟡 volatility_20 Rolling ICIR 滚动ICIR=0.19 (Registered 注册 0.43) ← Decay 衰减 56%
Diagnosis 诊断: <cause analysis 原因分析>
Suggestion 建议: Reduce weight, observe 1 month / 降低权重,观察1个月
Summary 总览: N🟢 N🟡 N🔴 / Total 共 N active factors 个活跃因子
reg.update_status("factor_name", "warning") # or 或 "alert"