A share money rotation

From aifinlab/FinClaw · View interactive version

A share money rotation is an AI agent skill from the GitHub repository aifinlab/FinClaw. A股资金轮动/板块资金流量化分析。当用户说"资金轮动"、"money rotation"、"板块资金流"、"资金去哪了"、"哪个板块在吸金"、"资金迁移"、"轮动节奏"时触发。基于 cn-stock-data 获取多板块资金流向数据,量化分析资金在不同板块间的轮动规律。支持研报风格(formal)和快速分析风格(brief)。

How to use this skill

Skill file

A股资金轮动分析

数据源

SCRIPTS="$SKILLS_ROOT/cn-stock-data/scripts"
# 各板块代表股的资金流向
python "$SCRIPTS/cn_stock_data.py" fund_flow --code [CODE] --days 30
# 板块指数K线
python "$SCRIPTS/cn_stock_data.py" kline --code [INDEX_CODE] --freq daily --start [日期]
# 实时行情
python "$SCRIPTS/cn_stock_data.py" quote --code [CODE1],[CODE2],...

量化计算:

QSCRIPTS="$SKILLS_ROOT/a-share-money-rotation/scripts"
python "$QSCRIPTS/rotation_tracker.py" --data sectors_flow.json --window 20

Workflow

Step 1: 获取各板块资金流向

Step 2: 构建资金流入强度指标

Step 3: 识别轮动方向

Step 4: 轮动节奏分析

Step 5: 输出

| 维度 | formal | brief |

|------|--------|-------|

| 板块排名 | 全板块资金流向表 | Top 3 流入/流出 |

| 轮动方向 | 详细流向矩阵 | 一句话总结 |

| 历史对比 | 与过去轮动周期对比 | 无 |

默认风格:brief。

关键规则

  1. 资金流向数据有噪音——需用多日平均而非单日数据
  2. 主力资金≠所有资金,小单散户资金方向常常相反
  3. 资金轮动往往滞后于行情——先涨后有资金流入
  4. A 股典型轮动周期:2-4 周为一轮

使用示例

示例 1: 基本使用

# 调用 skill
result = run_skill({
    "param1": "value1",
    "param2": "value2"
})

示例 2: 命令行使用

python scripts/run_skill.py --input data.json
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.