Alpha Monitor logo

Alpha Monitor

Community
VernonOY
alpha-monitor

Factor monitoring. Check active factors for IC decay and health issues. 因子监控。检查活跃因子的IC衰减和健康状态。 Triggers: "health check", "monitor", "检查因子健康", "因子状态"

Overview

PublisherVernonOY
Repositoryalpha-skills
Skill namealpha-monitor
Stars
122
Forks
23
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by VernonOY on GitHub. Read the source before you install it.

Installation

Install the Alpha Monitor AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/VernonOY/alpha-skills/tree/main/skills/alpha-monitor
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/VernonOY/alpha-skills.git /tmp/alpha-skills
mkdir -p .claude/skills
cp -r /tmp/alpha-skills/skills/alpha-monitor .claude/skills/alpha-monitor
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Alpha Monitor in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Alpha Monitor on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Alpha Monitor is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

alpha-monitor — Factor Health Monitoring / 因子健康监控

你是一个因子监控系统。检查因子库中所有活跃因子的当前健康状态。 You are a factor monitoring system. Check health status of all active factors in the library.

Bilingual Terms / 双语术语

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门控检查

项目定位 / Project Context

Multi-Market Support / 多市场支持:

Alpha Skills support A-share (default), HK, and US stocks via data adapters: Alpha Skills 通过数据适配器支持A股(默认)、港股和美股:

markdown
# .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 / 语言规则:

  • If the user speaks English, output in English
  • If the user speaks Chinese, output in Chinese
  • Table headers always show both languages: "IC Mean IC均值"

执行流程 / Execution Pipeline

Step 1: 读取因子库 / Read Factor Library

python
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.

Step 2: 加载近期数据 / Load Recent Data

加载最近1年的数据用于计算滚动指标(同alpha-evaluate的数据加载流程)。 Load last 1 year of data for rolling metrics (same as alpha-evaluate data loading pipeline).

Step 3: 对每个活跃因子计算健康指标 / Compute Health Metrics for Each Active Factor

对每个因子 / For each factor:

  1. 重新计算因子值 Recompute factor values(使用注册时的expression/函数调用 using registered expression/function call)
  2. 计算近60日滚动IC均值 Compute 60-day rolling IC mean
  3. 计算近60日滚动ICIR Compute 60-day rolling ICIR
  4. 与注册时的ICIR对比,计算衰减比例 Compare with registered ICIR, compute decay ratio
  5. 计算近3个月IC>0的占比 Compute IC>0 ratio for last 3 months
  6. 判定健康状态 Determine health status

Step 4: 健康状态判定 / Health Status Determination

🟢 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 分组单调性崩溃

Step 5: 对WARNING/ALERT因子生成诊断 / Generate Diagnosis for WARNING/ALERT Factors

分析可能的原因 Analyze possible causes:

  • 市场环境变化 Market regime change(趋势→震荡 trending→range-bound,或反之 or vice versa)
  • 因子拥挤 Factor crowding(与主流指数相关性升高 increased correlation with major indices)
  • 数据问题 Data issues(缺失率升高 higher missing rate)
  • 季节性效应 Seasonal effects

给出建议 Provide suggestions:

  • 🟡 WARNING: "Reduce weight, continue monitoring / 降低权重,继续观察"
  • 🔴 ALERT: "Suspend usage, consider retiring or finding replacement / 暂停使用,考虑退役或寻找替代"

Step 6: 输出报告 / Output Report

🏥 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 个活跃因子

Step 7: 更新注册表状态 / Update Registry Status

python
reg.update_status("factor_name", "warning")  # or 或 "alert"

注意事项 / Notes

  1. 如果因子库只有少量因子,监控仍然运行(哪怕只有1个)/ Monitoring still runs even with just 1 factor
  2. 滚动窗口60日,不够60日时用全部可用数据 / Rolling window 60 days, use all available data if less than 60 days
  3. 诊断信息由AI推理生成,基于市场环境和因子特性 / Diagnosis is AI-generated based on market environment and factor characteristics
  4. 建议更新状态但不自动退役,退役需要用户确认 / Suggest status update but no auto-retire, retirement needs user confirmation

Frequently asked questions

What does the Alpha Monitor AI skill do?

Factor monitoring. Check active factors for IC decay and health issues. 因子监控。检查活跃因子的IC衰减和健康状态。 Triggers: "health check", "monitor", "检查因子健康", "因子状态"

Why use Alpha Monitor on TypingMind?

Because you install it once and use it with any model. Alpha Monitor is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Alpha Monitor in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/VernonOY/alpha-skills/tree/main/skills/alpha-monitor. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Alpha Monitor?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Alpha Monitor?

As many as you like. As long as a model supports skills, you can use Alpha Monitor with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Alpha Monitor AI skill free?

Yes. It is published on GitHub by VernonOY under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇