stock-sector-monitoring
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStock Sector Monitoring Skill
Stock Sector Monitoring Skill
用于基于 Tushare 的 A 股市场监测,重点支持:
- 概念板块监测()
sector - 龙虎榜每日明细(,
lhb/ doc_id=106)top_list - 将结果输出并保存为 Markdown 文件
It is used for A-share market monitoring based on Tushare, and mainly supports:
- Concept sector monitoring ()
sector - Daily details of Dragon Tiger List (,
lhb/ doc_id=106)top_list - Output and save results as Markdown files
When to Use
When to Use
当用户出现以下意图时使用本 skill:
- “监控概念板块/行业热度/涨幅榜”
- “查询龙虎榜数据”
- “过滤 ST 股票后输出结果”
- “把监控结果保存成 markdown/md 文件”
Use this skill when users have the following intentions:
- "Monitor concept sector/industry popularity/ranking list of gainers"
- "Query Dragon Tiger List data"
- "Filter ST stocks and output results"
- "Save monitoring results as markdown/md files"
Prerequisites
Prerequisites
在 skill 根目录执行:
bash
cd /Users/yujian/Code/py/aj-skills/skills/stock-sector-monitoring依赖准备:
bash
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -U pip
python3 -m pip install tushare pandasTushare token 约定从 读取:
~/.aj-skills/.envbash
undefinedExecute in the skill root directory:
bash
cd /Users/yujian/Code/py/aj-skills/skills/stock-sector-monitoringDependency preparation:
bash
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -U pip
python3 -m pip install tushare pandasTushare token is agreed to be read from :
~/.aj-skills/.envbash
undefined~/.aj-skills/.env
~/.aj-skills/.env
TUSHARE_TOKEN=your_token
undefinedTUSHARE_TOKEN=your_token
undefinedCore Workflow
Core Workflow
1) 采集龙虎榜数据(默认推荐)
1) Collect Dragon Tiger List data (recommended by default)
bash
source .venv/bin/activate
python3 scripts/sector-monitoring.py \
--once \
--data-source lhb \
--trade-date 20260213 \
--top 20 \
--format json说明:
- 使用龙虎榜接口(
--data-source lhb)top_list - 指定交易日,默认是当天
--trade-date YYYYMMDD - 当前脚本已内置过滤 ST / ST / SST / SST 股票
bash
source .venv/bin/activate
python3 scripts/sector-monitoring.py \
--once \
--data-source lhb \
--trade-date 20260213 \
--top 20 \
--format jsonDescription:
- uses Dragon Tiger List interface (
--data-source lhb)top_list - specifies the trading date, default is the current day
--trade-date YYYYMMDD - The current script has built-in filtering of ST / ST / SST / SST stocks
2) 板块异动+新闻联动分析(必须)
2) Sector fluctuation and news linkage analysis (mandatory)
每次执行都必须完成该分析,不需要用户额外提问;完成分析后才可生成对应报告。
Step 1: 识别异动板块
从板块监测数据中提取涨幅前 N 的板块。
从板块监测数据中提取涨幅前 N 的板块。
Step 2: 搜索相关新闻
针对异动板块,搜索近期新闻:
针对异动板块,搜索近期新闻:
- 行业政策变化
- 价格/供需变化
- 龙头公司动态
- 国际市场影响
Step 3: 形成异动原因结论
整合板块数据 + 新闻,产出可写入报告的异动原因分析结论。
整合板块数据 + 新闻,产出可写入报告的异动原因分析结论。
This analysis must be completed for each execution without additional user inquiries; the corresponding report can be generated only after the analysis is completed.
Step 1: Identify fluctuating sectors
Extract the top N sectors by gain from sector monitoring data.
Extract the top N sectors by gain from sector monitoring data.
Step 2: Search related news
Search recent news for fluctuating sectors:
Search recent news for fluctuating sectors:
- Industry policy changes
- Price/supply and demand changes
- Leading company trends
- International market impact
Step 3: Form conclusions on fluctuation reasons
Integrate sector data and news to produce analysis conclusions on fluctuation reasons that can be written into the report.
Integrate sector data and news to produce analysis conclusions on fluctuation reasons that can be written into the report.
3) 生成 Markdown 报告
3) Generate Markdown report
在完成第 2 步分析后,将 JSON 输出与异动原因结论整理成 Markdown,并保存到 目录。
reports/报告标题要求(必须):
- 先生成一个吸引人的标题,适合社交媒体分享。
- 标题需体现“异动板块 + 关键驱动/新闻线索”,避免仅使用“日报/监测”这类平铺命名。
- 标题控制在 18-32 字,信息密度高,可读性强。
领涨板块输出要求(必须):
- 必须输出 章节。
今日领涨板块原因分析 - 至少覆盖涨幅前 1-3 个板块(默认 3 个,可按数据完整性调整)。
- 每个板块必须包含:板块名+涨幅、核心逻辑、驱动因素表、趋势结论。
- 中的
涨幅榜必须为移动端短句,单条建议不超过 16 个汉字(或 24 个字符),仅保留关键信息。上榜理由
文件命名规范:
- 龙虎榜日报:
reports/lhb-YYYYMMDD.md - 指定股票:
reports/lhb-YYYYMMDD-TS_CODE.md - 概念板块:
reports/sector-YYYYMMDD.md
Markdown 最低结构:
markdown
undefinedAfter completing the analysis in Step 2, organize the JSON output and fluctuation reason conclusions into Markdown, and save it to the directory.
reports/Report title requirements (mandatory):
- First generate an attractive title suitable for social media sharing.
- The title should reflect "fluctuating sector + key driver/news clue", avoid using plain names such as "daily report/monitoring".
- The title should be controlled within 18-32 characters, with high information density and strong readability.
Leading sector output requirements (mandatory):
- The chapter must be output.
Analysis of Reasons for Today's Leading Sectors - Cover at least the top 1-3 sectors by gain (3 by default, adjustable according to data integrity).
- Each sector must include: sector name + gain, core logic, driver table, trend conclusion.
- The in the
listing reasonmust be short sentences suitable for mobile terminals, each suggested to be no more than 16 Chinese characters (or 24 characters), only key information is retained.gainer list
File naming convention:
- Dragon Tiger List daily report:
reports/lhb-YYYYMMDD.md - Specified stocks:
reports/lhb-YYYYMMDD-TS_CODE.md - Concept sector:
reports/sector-YYYYMMDD.md
Minimum Markdown structure:
markdown
undefined【板块异动】算力板块领涨:政策催化+龙头放量(YYYY-MM-DD)
【板块异动】算力板块领涨:政策催化+龙头放量(YYYY-MM-DD)
今日领涨板块原因分析
今日领涨板块原因分析
1. 有色金属(铅锌 +5.76%、小金属 +4.65%、铜 +2.96%)
1. 有色金属(铅锌 +5.76%、小金属 +4.65%、铜 +2.96%)
核心逻辑:需求爆发 + 供给收缩
| 驱动因素 | 具体内容 |
|---|---|
| 国际金属价格普涨 | LME 铜涨超 1.7%,锡涨超 4.6%,海外定价中枢上移 |
| AI 产业需求 | 算力与数据中心建设拉动铜等导电金属需求 |
| 新能源需求 | 锑、钨、稀土、锡等小金属受新能源产业链拉动 |
| 供给管控 | 国内供给管控政策持续,供需缺口支撑价格 |
| 货币环境 | 国际货币环境宽松,风险偏好提升带动商品走强 |
趋势结论:有色金属正从周期品向战略资源属性演进,阶段性主线仍看供需错配与产业升级共振。
核心逻辑:需求爆发 + 供给收缩
| 驱动因素 | 具体内容 |
|---|---|
| 国际金属价格普涨 | LME 铜涨超 1.7%,锡涨超 4.6%,海外定价中枢上移 |
| AI 产业需求 | 算力与数据中心建设拉动铜等导电金属需求 |
| 新能源需求 | 锑、钨、稀土、锡等小金属受新能源产业链拉动 |
| 供给管控 | 国内供给管控政策持续,供需缺口支撑价格 |
| 货币环境 | 国际货币环境宽松,风险偏好提升带动商品走强 |
趋势结论:有色金属正从周期品向战略资源属性演进,阶段性主线仍看供需错配与产业升级共振。
涨幅榜 Top N
涨幅榜 Top N
| 排名 | 代码 | 名称 | 涨跌幅 | 龙虎榜净买入额(亿) | 净买额占比(%) | 上榜理由(短句) |
|---|
| 排名 | 代码 | 名称 | 涨跌幅 | 龙虎榜净买入额(亿) | 净买额占比(%) | 上榜理由(短句) |
|---|
综合评分 Top N
综合评分 Top N
| 排名 | 代码 | 名称 | 综合评分 | 涨跌幅 | 龙虎榜净买入额(亿) |
|---|
| 排名 | 代码 | 名称 | 综合评分 | 涨跌幅 | 龙虎榜净买入额(亿) |
|---|
预警
预警
- 列出超过阈值的标的(若无则写“无”)
- 列出超过阈值的标的(若无则写“无”)
免责声明
免责声明
本文为市场复盘与信息整理,不构成任何投资建议。市场有风险,决策需结合自身风险承受能力并独立判断。
undefined本文为市场复盘与信息整理,不构成任何投资建议。市场有风险,决策需结合自身风险承受能力并独立判断。
undefined4) 保存要求(必须)
4) Saving requirements (mandatory)
每次响应都应:
- 明确输出文件路径
- 将最终结果落盘为
.md - 在回复中给出“已保存到:”
<path>
Each response should:
- Clearly output the file path
- Save the final result as file on disk
.md - Give "Saved to: " in the reply
<path>
5) 发布询问与公众号发布(必须)
5) Release inquiry and Official WeChat Account release (mandatory)
报告生成并保存后,必须追加询问用户是否需要发布到公众号。
标准询问:
- “报告已生成,是否需要我直接发布到公众号?”
执行规则:
- 若用户确认“需要”,调用 skill(
post-to-wechat)发布。baoyu-post-to-wechat - 若用户未确认或拒绝,不进行发布操作,仅保留本地报告文件。
After the report is generated and saved, you must additionally ask the user whether it needs to be released to the Official WeChat Account.
Standard inquiry:
- "The report has been generated, do you need me to publish it directly to the Official WeChat Account?"
Execution rules:
- If the user confirms "yes", call the skill (
post-to-wechat) to publish.baoyu-post-to-wechat - If the user does not confirm or refuses, no release operation is performed, only the local report file is retained.
Output Rules
Output Rules
- 默认输出 Markdown,不仅在对话中展示。
- 仅输出分析报告正文,不输出数据来源说明、接口信息或过滤规则说明。
- 报告主标题必须为“吸引人的社交媒体风格标题”,不能使用通用占位标题。
- 报告必须包含 ,且每个领涨板块都要给出“核心逻辑 + 驱动因素表 + 趋势结论”。
今日领涨板块原因分析 - 的
涨幅榜必须压缩为移动端短句,不得出现过长原文搬运。上榜理由 - 报告结尾必须追加 章节,且位于最后一节。
免责声明 - 如用户未指定文件名,按命名规范自动生成。
- 如用户指定日期或 TS 代码,文件名必须反映该条件。
- 若当日无数据,仍生成 Markdown,并在正文写明“无可用数据(非交易日/无上榜)”。
- 报告保存完成后,必须询问用户是否发布到公众号;仅在用户明确同意后调用 skill。
post-to-wechat
- Output Markdown by default, not only displayed in the conversation.
- Only output the body of the analysis report, do not output data source description, interface information or filtering rule description.
- The main title of the report must be an "attractive social media-style title", and generic placeholder titles cannot be used.
- The report must include , and each leading sector must be given "core logic + driver table + trend conclusion".
Analysis of Reasons for Today's Leading Sectors - The of the
listing reasonmust be compressed into short sentences suitable for mobile terminals, and excessive original text copying is not allowed.gainer list - The chapter must be added at the end of the report and be the last section.
Disclaimer - If the user does not specify a file name, it will be automatically generated according to the naming convention.
- If the user specifies a date or TS code, the file name must reflect this condition.
- If there is no data on the day, Markdown is still generated, and "No available data (non-trading day/no listing)" is written in the body.
- After the report is saved, you must ask the user whether to publish it to the Official WeChat Account; call the skill only after the user explicitly agrees.
post-to-wechat
Quality Checklist
Quality Checklist
- 已完成板块异动+新闻联动分析,并写入报告
- 报告标题已按社交媒体分享场景优化
- 领涨板块输出已按模板包含:板块涨幅、核心逻辑、驱动因素表、趋势结论
- 涨幅榜 已压缩为移动端短句
上榜理由 - 报告末尾已追加免责声明
- 报告正文未包含数据来源说明与过滤规则说明
- 表格列名完整、单位清晰(金额统一“亿元”)
- 报告已保存为
.md - 回复中包含保存路径
- 已询问用户是否发布到公众号;如用户确认,已调用 skill 发布
post-to-wechat
- Sector fluctuation and news linkage analysis has been completed and written into the report
- The report title has been optimized for social media sharing scenarios
- The leading sector output has included according to the template: sector gain, core logic, driver table, trend conclusion
- The of the gainer list has been compressed into short sentences suitable for mobile terminals
listing reason - A disclaimer has been added at the end of the report
- The body of the report does not include data source description and filtering rule description
- Table column names are complete and units are clear (amount is uniformly in "100 million yuan")
- The report has been saved as
.md - The reply includes the save path
- Have asked the user whether to publish to the Official WeChat Account; if the user confirms, the skill has been called to publish
post-to-wechat
Notes
Notes
- 龙虎榜接口权限要求较高(通常需积分权限)。
top_list - 若接口返回为空,优先提示交易日与权限问题,再输出空报告模板。
- The Dragon Tiger List interface has high permission requirements (usually requires point permission).
top_list - If the interface returns empty, first prompt the trading day and permission issues, then output the empty report template.