tushare-data

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

tushare-data

tushare-data

把自然语言财经数据请求,转成可执行的 Tushare 数据工作流。
这是一个面向自然语言的金融数据研究 skill。
Convert natural language financial data requests into executable Tushare data workflows.
This is a natural language-oriented financial data research skill.

What this skill is for

What this skill is for

使用这个 skill 的典型场景:
  • 看某只股票、指数、ETF 最近走势
  • 查公司基本资料、估值、财务趋势
  • 做多标的横向对比
  • 看资金流、北向资金、龙虎榜、板块强弱
  • 梳理公告、新闻、研报、政策线索
  • 查看 CPI / PPI / PMI / 社融 / 利率等宏观数据
  • 导出 CSV / parquet 供后续分析或回测使用
  • 生成简洁研究摘要,而不是只吐原始字段表
先理解用户要解决什么问题,再去选接口、取数、整理、解释、交付。

Typical scenarios for using this skill:
  • Check the recent performance of a specific stock, index, or ETF
  • Look up a company's basic information, valuation, and financial trends
  • Conduct horizontal comparisons of multiple target assets
  • Track capital flows, northbound funds, Dragon & Tiger List, and sector strength
  • Organize announcements, news, research reports, and policy clues
  • View macroeconomic data such as CPI / PPI / PMI / social financing / interest rates
  • Export data to CSV / parquet for subsequent analysis or backtesting
  • Generate concise research summaries instead of just raw field tables
First understand the problem the user wants to solve, then select interfaces, retrieve data, organize, explain, and deliver results.

When to use

When to use

当用户表达以下意图时,优先使用本 skill:
Prioritize using this skill when users express the following intents:

行情 / 趋势

Market Trends / Performance

  • 看下 XX 最近怎么样
  • XX 这段时间涨得怎么样
  • 今年以来表现如何
  • 最近有没有放量
  • 这票最近强不强
  • How has XX been doing lately?
  • How has XX performed during this period?
  • How has it performed since the beginning of the year?
  • Has there been a recent volume surge?
  • Is this stock performing strongly lately?

财务 / 估值 / 公司质量

Finance / Valuation / Company Quality

  • 看下 XX 财报
  • 最近几个季度利润趋势
  • 财务质量怎么样
  • 现金流好不好
  • 现在估值算高吗
  • 帮我看 PE / PB / ROE / 毛利率
  • Check XX's financial report
  • Profit trends in recent quarters
  • How is the financial quality?
  • Is the cash flow healthy?
  • Is the current valuation high?
  • Help me check PE / PB / ROE / gross profit margin

对比 / 排行 / 筛选

Comparison / Ranking / Screening

  • XX 和 YY 谁更强
  • 帮我横向比较一下
  • 哪些公司利润增长更快
  • 帮我筛一下高 ROE 低负债
  • 给我排个前十
  • Which is stronger, XX or YY?
  • Help me make a horizontal comparison
  • Which companies have faster profit growth?
  • Help me screen for companies with high ROE and low debt
  • Give me a top 10 ranking

板块 / 指数 / 主题

Sectors / Indices / Themes

  • 最近哪个板块最强
  • 半导体最近怎么样
  • 机器人为什么涨
  • 指数成分股有哪些
  • 哪些主题最热
  • Which sector is the strongest recently?
  • How has the semiconductor sector been performing lately?
  • Why are robot stocks rising?
  • What are the components of this index?
  • Which themes are the hottest right now?

资金流 / 情绪

Capital Flows / Market Sentiment

  • 最近资金在买什么
  • 北向资金最近流向哪里
  • 哪个板块最吸金
  • 主力资金流入最多的是谁
  • 龙虎榜上有什么看点
  • What are funds buying recently?
  • Where are northbound funds flowing lately?
  • Which sector is attracting the most capital?
  • Which stocks have the largest main capital inflows?
  • What are the key points from the Dragon & Tiger List?

公告 / 新闻 / 研报 / 政策

Announcements / News / Research Reports / Policies

  • 最近有什么公告
  • 帮我梳理下 XX 公告
  • 最近有没有什么催化
  • 最近新闻面怎么样
  • 最近有什么重要政策
  • What announcements have been released recently?
  • Help me organize XX's announcements
  • Are there any catalytic events lately?
  • How is the news sentiment recently?
  • What important policies have been issued lately?

宏观 / 跨市场

Macroeconomics / Cross-Market

  • 最近宏观环境怎么样
  • CPI / PMI 最近怎么看
  • 当前市场风格偏什么
  • 大盘环境偏多还是偏空
  • 港股 / 美股 / 美债最近怎么样
  • How is the recent macroeconomic environment?
  • What's the outlook for recent CPI / PMI?
  • What's the current market style leaning towards?
  • Is the broader market bullish or bearish?
  • How have Hong Kong stocks / US stocks / US bonds been performing lately?

数据导出 / 研究准备

Data Export / Research Preparation

  • 给我导出一份行情数据
  • 把近两年日线拉成 CSV
  • 生成可回测的数据表
  • 拉一个研究表供后续分析

  • Export a market data report for me
  • Pull the daily data of the past two years into a CSV
  • Generate a data table for backtesting
  • Create a research table for subsequent analysis

What this skill is NOT for

What this skill is NOT for

这个 skill 不适合:
  • 直接给买卖建议或替代投资顾问
  • 自动下单或执行交易
  • 需要毫秒级实时交易决策的场景
  • 复杂回测引擎、组合优化系统本身的实现(那是另一个工程)
  • 在没有 Tushare 权限/积分支持的情况下强行伪造数据
如果数据权限不够、接口不可用或时间范围不合理,要明确说出限制,不要硬编。

This skill is NOT suitable for:
  • Providing direct trading advice or replacing investment advisors
  • Automatic order placement or trade execution
  • Scenarios requiring millisecond-level real-time trading decisions
  • Implementing complex backtesting engines or portfolio optimization systems (that's a separate project)
  • Forcing fake data when there's no Tushare permission/point support
If data permissions are insufficient, interfaces are unavailable, or time ranges are unreasonable, clearly state the limitations instead of fabricating data.

Natural-language trigger guide

Natural-language trigger guide

即使用户完全不说
tushare
financials
macro
这些术语,只要意图符合以下含义,也应该触发本 skill。
Even if users never mention terms like
tushare
,
financials
, or
macro
, this skill should be triggered as long as their intent matches the following meanings.

常见口语触发

Common spoken triggers

  • 看看这个股票最近怎么样
  • 给我快速研究一下 XX
  • 上次说的那只票现在什么情况
  • 帮我看下财报
  • 最近哪个板块最强
  • 北向最近在买什么
  • 有什么催化消息
  • 这个公司值不值得重点看
  • 给我拉份数据
  • 导出成 CSV
  • 帮我筛一批票
  • 把这几个公司对比一下
  • How has this stock been performing lately?
  • Give me a quick analysis of XX
  • How is that stock we talked about last time doing now?
  • Help me check the financial report
  • Which sector is the strongest recently?
  • What are northbound funds buying lately?
  • Are there any catalytic events?
  • Is this company worth focusing on?
  • Pull some data for me
  • Export to CSV
  • Help me screen a batch of stocks
  • Compare these companies for me

中文自然语言优先原则

Chinese natural language priority principle

用户说人话时,先理解任务,不要先回到接口名和字段名。 优先把:
  • “最近” 解释成合理时间窗
  • “财报” 解释成最近 8 个季度 / 最近年度
  • “强不强” 解释成走势 + 相对强弱 + 活跃度
  • “资金关注” 解释成净流入、活跃成交、龙虎榜/北向等可用口径
如果任务有多个合理解释,再做最小澄清。

When users speak in plain language, first understand the task, don't jump to interface names and field names first. Prioritize interpreting:
  • "Recently" as a reasonable time window
  • "Financial report" as the latest 8 quarters / latest annual report
  • "Strong or not" as performance + relative strength + activity
  • "Capital attention" as net inflow, active trading, available calibers like Dragon & Tiger List / northbound funds
If there are multiple reasonable interpretations for a task, make minimal clarifications.

Environment check

Environment check

在真正请求数据之前,先做前置校验:
  1. 检查 Python 是否可用, 版本要求 3.7+
  2. 检查
    tushare
    包是否已安装·
  3. 检查
    TUSHARE_TOKEN
    是否存在, 或者运行py脚本
    import tushare as ts; print(ts.get_token())"
    检查本地是否已配置
  4. 必要时做一次轻量接口冒烟测试(如交易日历 / 基础接口)
  5. 如用户请求高权限接口,提前提示可能存在积分/权限限制
若缺失 token,直接提示最短修复路径,例如:
bash
export TUSHARE_TOKEN=your_token
不要等到主查询跑失败了才暴露环境问题。

Before requesting data, perform pre-checks:
  1. Check if Python is available, version requirement: 3.7+
  2. Check if the
    tushare
    package is installed
  3. Check if
    TUSHARE_TOKEN
    exists, or run the Python script
    import tushare as ts; print(ts.get_token())
    to check local configuration
  4. Perform a lightweight interface smoke test if necessary (e.g., trading calendar / basic interface)
  5. If the user requests a high-permission interface, remind them in advance of possible point/permission limitations
If the token is missing, directly provide the shortest fix path, for example:
bash
export TUSHARE_TOKEN=your_token
Don't wait until the main query fails to expose environment issues.

Intent taxonomy

Intent taxonomy

先识别任务类型,再决定接口组合。
First identify the task type, then determine the interface combination.

1. 行情 / 趋势

1. Market Trends / Performance

典型问题:
  • 最近走势怎么样
  • 今年涨了多少
  • 最近波动大不大
  • 最近有没有放量
常用接口:
  • daily
  • pro_bar
  • weekly
  • monthly
  • stk_mins
  • rt_k
    /
    rt_min
    (如确需实时口径且权限允许)
  • daily_basic
Typical questions:
  • How has the performance been lately?
  • How much has it risen this year?
  • Has there been high volatility recently?
  • Has there been a volume surge lately?
Common interfaces:
  • daily
  • pro_bar
  • weekly
  • monthly
  • stk_mins
  • rt_k
    /
    rt_min
    (only if real-time caliber is required and permitted)
  • daily_basic

2. 基本资料 / 标的识别

2. Basic Information / Target Resolution

典型问题:
  • 这是什么公司 / 什么指数 / 什么基金
  • 是创业板吗 / 是 ST 吗 / 什么时候上市
常用接口:
  • stock_basic
  • fund_basic
  • index_basic
  • stock_company
  • stock_st
    /
    st
Typical questions:
  • What company / index / fund is this?
  • Is it a ChiNext stock / ST stock? When was it listed?
Common interfaces:
  • stock_basic
  • fund_basic
  • index_basic
  • stock_company
  • stock_st
    /
    st

3. 财务 / 公司质量

3. Finance / Company Quality

典型问题:
  • 最近几个季度利润趋势
  • 最近几个季度营收和净利润趋势
  • 财务质量怎么样
  • ROE / 毛利率 / 现金流如何
常用接口:
  • income
    (营收 / 净利润趋势优先)
  • fina_indicator
    (ROE / 毛利率 / 净利率等质量指标补充)
  • balancesheet
  • cashflow
  • forecast
  • express
  • disclosure_date
Typical questions:
  • Profit trends in recent quarters
  • Revenue and net profit trends in recent quarters
  • How is the financial quality?
  • How are ROE / gross profit margin / cash flow?
Common interfaces:
  • income
    (priority for revenue / net profit trends)
  • fina_indicator
    (supplementary for quality indicators like ROE / gross profit margin / net profit margin)
  • balancesheet
  • cashflow
  • forecast
  • express
  • disclosure_date

4. 估值 / 基本面指标

4. Valuation / Fundamental Indicators

典型问题:
  • 现在估值高不高
  • 谁更便宜
  • PE / PB / 股息率如何
常用接口:
  • daily_basic
  • fina_indicator
Typical questions:
  • Is the current valuation high?
  • Which is cheaper?
  • How are PE / PB / dividend yield?
Common interfaces:
  • daily_basic
  • fina_indicator

5. 资金流 / 市场行为

5. Capital Flows / Market Behavior

典型问题:
  • 北向最近买什么
  • 主力资金流向
  • 龙虎榜情况
常用接口:
  • moneyflow
  • moneyflow_hsgt
  • hsgt_top10
  • top_list
  • top_inst
  • moneyflow_ind_dc
  • moneyflow_mkt_dc
Typical questions:
  • What are northbound funds buying lately?
  • Main capital flow directions
  • Dragon & Tiger List status
Common interfaces:
  • moneyflow
  • moneyflow_hsgt
  • hsgt_top10
  • top_list
  • top_inst
  • moneyflow_ind_dc
  • moneyflow_mkt_dc

6. 板块 / 指数 / 主题

6. Sectors / Indices / Themes

典型问题:
  • 最近哪个板块最强
  • 行业轮动如何
  • 某板块有哪些成分股
常用接口:
  • index_basic
  • index_daily
  • index_classify
  • index_member_all
  • sw_daily
  • ths_index
  • ths_member
  • dc_index
  • dc_member
Typical questions:
  • Which sector is the strongest recently?
  • How is sector rotation?
  • What are the components of this sector?
Common interfaces:
  • index_basic
  • index_daily
  • index_classify
  • index_member_all
  • sw_daily
  • ths_index
  • ths_member
  • dc_index
  • dc_member

7. 打板 / 情绪 / 活跃度

7. Price Limit / Sentiment / Activity

典型问题:
  • 今天涨停梯队
  • 连板结构
  • 炸板率 / 情绪强弱
常用接口:
  • limit_list_d
  • limit_step
  • kpl_list
  • dc_hot
  • ths_hot
Typical questions:
  • Today's price limit ladder
  • Continuous price limit structure
  • Price limit failure rate / sentiment strength
Common interfaces:
  • limit_list_d
  • limit_step
  • kpl_list
  • dc_hot
  • ths_hot

8. 公告 / 新闻 / 研报 / 政策

8. Announcements / News / Research Reports / Policies

典型问题:
  • 最近有什么公告或催化
  • 最近有什么研究报告
  • 最近政策面发生了什么
常用接口:
  • anns_d
  • news
  • major_news
  • research_report
  • npr
  • irm_qa_sh
  • irm_qa_sz
Typical questions:
  • Are there any recent announcements or catalytic events?
  • What research reports have been released lately?
  • What policy changes have occurred recently?
Common interfaces:
  • anns_d
  • news
  • major_news
  • research_report
  • npr
  • irm_qa_sh
  • irm_qa_sz

9. 宏观 / 跨市场

9. Macroeconomics / Cross-Market

典型问题:
  • CPI / PMI / 社融 / M2
  • 利率与收益率曲线
  • 港股 / 美股 / 美债数据
常用接口:
  • cn_cpi
  • cn_ppi
  • cn_pmi
  • cn_gdp
  • cn_m
  • sf_month
  • shibor
  • shibor_lpr
  • us_tycr
  • us_daily
  • hk_daily
  • index_global
Typical questions:
  • CPI / PMI / social financing / M2
  • Interest rates and yield curves
  • Hong Kong stock / US stock / US bond data
Common interfaces:
  • cn_cpi
  • cn_ppi
  • cn_pmi
  • cn_gdp
  • cn_m
  • sf_month
  • shibor
  • shibor_lpr
  • us_tycr
  • us_daily
  • hk_daily
  • index_global

10. 导出 / 研究准备

10. Export / Research Preparation

典型问题:
  • 导出某标的一段时间行情
  • 生成回测用数据表
  • 输出 CSV / parquet
常用接口:
  • 取决于上游任务,核心是统一输出规则与命名规范

Typical questions:
  • Export market data for a target over a period
  • Generate a data table for backtesting
  • Output to CSV / parquet
Common interfaces:
  • Depends on upstream tasks, core is unified output rules and naming conventions

Entity resolution rules

Entity resolution rules

标的解析

Target Resolution

  • 优先识别股票名、股票代码、指数名、ETF 名、基金名
  • 对中文简称先尝试匹配标准对象
  • 若重名或多解,列出候选并做最小澄清
  • 证券代码内部统一为标准格式,如:
    600519.SH
    000001.SZ
  • Prioritize identifying stock names, stock codes, index names, ETF names, fund names
  • First try to match standard objects with Chinese abbreviations
  • If there are duplicate names or multiple interpretations, list candidates and make minimal clarifications
  • Unify securities codes into standard formats, e.g.:
    600519.SH
    ,
    000001.SZ

市场识别

Market Identification

  • 默认先按 A 股理解,除非用户明确提到港股 / 美股 / 基金 / 债券 / 期货
  • 指数、ETF、个股要分开判断,不要混用接口
  • Default to A-shares unless the user explicitly mentions Hong Kong stocks / US stocks / funds / bonds / futures
  • Distinguish between indices, ETFs, and individual stocks, do not mix interfaces

时间默认值

Default Time Values

若用户没有明确给时间范围,使用合理默认:
  • “最近走势” → 默认近 20 个交易日
  • “这段时间 / 最近一段时间” → 默认近 3 个月
  • “财报 / 业绩” → 默认最近 8 个季度 + 最近年度
  • “资金流最近如何” → 默认近 5~20 个交易日,按任务粒度调整
  • “宏观最近如何” → 默认看最近 6~12 期
If the user does not specify a time range, use reasonable defaults:
  • "Recent performance" → default to the last 20 trading days
  • "This period / recent period" → default to the last 3 months
  • "Financial report / performance" → default to the latest 8 quarters + latest annual report
  • "Recent capital flows" → default to 5~20 trading days, adjusted based on task granularity
  • "Recent macroeconomics" → default to the latest 6~12 periods

板块口径默认值

Default Sector Caliber

若用户只说“板块 / 行业 / 概念”但未指定分类体系:
  • 行业优先用申万 / 中信等较稳定口径
  • 概念优先同花顺 / 东方财富等主题口径
  • 若结论依赖具体口径差异,要明确说明使用了哪种分类

If the user only mentions "sector / industry / concept" without specifying a classification system:
  • Prioritize stable calibers like Shenwan / CITIC for industries
  • Prioritize theme calibers like Tonghuashun / East Money for concepts
  • If conclusions depend on specific caliber differences, clearly state which classification is used

Input normalization rules

Input normalization rules

在请求数据前先做规范化:
  • 日期统一为
    YYYYMMDD
  • 检查
    start_date <= end_date
  • 用户输入未来日期时,自动裁剪到最近可用日期并提示
  • 裸代码如
    000001
    不要盲猜,能补全则说明补全规则,不能补全则澄清
  • 对冲突参数(如
    trade_date
    start_date/end_date
    同时给)要先裁决,不要直接乱传

Normalize inputs before requesting data:
  • Unify dates into
    YYYYMMDD
    format
  • Check that
    start_date <= end_date
  • If the user inputs a future date, automatically adjust to the latest available date and notify the user
  • Do not guess bare codes like
    000001
    ; if it can be completed, explain the completion rule; if not, ask for clarification
  • Resolve conflicting parameters (e.g.,
    trade_date
    and
    start_date/end_date
    provided simultaneously) before sending requests

Data retrieval rules

Data retrieval rules

文档先行

Documentation First

在写请求代码前,先确认:
  • 接口名是否正确
  • 必填参数
  • 可选参数
  • 返回字段
  • 积分 / 频率限制
不要仅凭记忆硬写字段名。
Before writing request code, confirm:
  • Correct interface name
  • Required parameters
  • Optional parameters
  • Returned fields
  • Point / frequency limits
Do not write field names based on memory alone.

字段确认

Field Confirmation

fields
参数,优先使用已知字段白名单或接口文档确认。 若用户要求字段不存在,应明确说明,而不是盲查。
For the
fields
parameter, prioritize using known field whitelists or interface documentation for confirmation. If the user requests a non-existent field, clearly state this instead of blindly querying.

默认分段拉取

Default Segment Retrieval

长区间数据不要一次性全拉。 建议:
  • 日线 / 周线 / 月线:按年或季度切片
  • 财报:按年份 / 报告期切片
  • 分钟数据:按月 / 周切片
  • 大批量多标的:按标的分批 + 日期分段
Do not retrieve long-range data all at once. Recommendations:
  • Daily / weekly / monthly data: slice by year or quarter
  • Financial reports: slice by year / reporting period
  • Minute-level data: slice by month / week
  • Large batches of multiple targets: batch by target + slice by date

重试与限流

Retry & Rate Limiting

  • 仅对瞬时错误(网络抖动、超时、429)进行有限重试
  • 参数错误、权限不足、字段错误不要盲重试
  • 批量拉取时加入节流,避免高频撞限
  • Only perform limited retries for transient errors (network jitter, timeouts, 429)
  • Do not blindly retry for parameter errors, insufficient permissions, or field errors
  • Add throttling during batch retrieval to avoid hitting rate limits due to high frequency

分段合并

Segment Merging

分段拉取后:
  • 合并
  • 去重
  • 按主键排序
  • 记录失败分段
  • 若部分成功,要明确告诉用户哪些段失败了

After segment retrieval:
  • Merge data
  • Remove duplicates
  • Sort by primary key
  • Record failed segments
  • If partially successful, clearly tell the user which segments failed

Output contract

Output contract

除非用户明确只要原始表,否则优先按这个结构输出:
  1. 一句话结论
  2. 数据范围与口径
  3. 关键指标 / 关键表格
  4. 异常点 / 风险点 / 解释限制
  5. 如有本地输出,给出文件路径
Unless the user explicitly requests only raw tables, prioritize outputting in this structure:
  1. One-sentence conclusion
  2. Data scope & caliber
  3. Key indicators / key tables
  4. Anomalies / risk points / interpretation limitations
  5. If there's local output, provide the file path

结果交付形态

Result Delivery Format

按任务复杂度选择:
  • 小结果:Markdown 摘要 + 简短表格
  • 中等数据表:CSV
  • 大规模 / 后续分析:Parquet
  • 需要可复用流程:附 Python 脚本
  • 需要可视化时:输出图表 PNG 或说明可绘制图表
Choose based on task complexity:
  • Small results: Markdown summary + short table
  • Medium data tables: CSV
  • Large-scale / subsequent analysis: Parquet
  • Reusable workflows: Attach Python script
  • Visualization needed: Output chart PNG or explain that charts can be generated

元信息

Metadata

生成数据文件时,尽量同时记录:
  • 接口名
  • 请求参数
  • 拉取时间
  • 数据行数
  • 字段列表
  • 是否存在失败分段 / 缺失

When generating data files, try to record:
  • Interface name
  • Request parameters
  • Retrieval time
  • Number of data rows
  • Field list
  • Whether there are failed segments / missing data

Workflow templates

Workflow templates

下面这些模板,是本 skill 的核心。 不要直接从接口想起,而要从任务模板想起。
These templates are the core of this skill. Don't start with interfaces, start with task templates.

1. 单标的行情分析

1. Single Target Market Analysis

适用:
  • 看下 XX 最近怎么样
  • 这票最近强不强
  • 今年以来表现如何
默认流程:
  1. 解析标的
  2. 确定时间范围
  3. 取行情 + 必要基础指标
  4. 总结区间涨跌、成交活跃度、高低点、波动
  5. 输出一句结论 + 关键数字
Applicable to:
  • How has XX been performing lately?
  • Is this stock performing strongly lately?
  • How has it performed since the beginning of the year?
Default workflow:
  1. Resolve the target
  2. Determine the time range
  3. Retrieve market data + necessary basic indicators
  4. Summarize interval price changes, trading activity, highs & lows, volatility
  5. Output a one-sentence conclusion + key figures

2. 多标的横向对比

2. Multi-Target Horizontal Comparison

适用:
  • XX 和 YY 谁更强
  • 把这几家公司对比一下
默认流程:
  1. 锁定对象
  2. 统一时间口径
  3. 选 3~5 个关键指标
  4. 输出对比表
  5. 给出“谁在哪方面更强”的总结
Applicable to:
  • Which is stronger, XX or YY?
  • Compare these companies for me
Default workflow:
  1. Lock the targets
  2. Unify the time caliber
  3. Select 3~5 key indicators
  4. Output a comparison table
  5. Provide a summary of "who is stronger in which aspects"

3. 财务质量快照

3. Financial Quality Snapshot

适用:
  • 看下 XX 财报
  • 最近几个季度利润趋势
  • 财务质量怎么样
默认流程:
  1. 拉最近 8 个季度 + 最近年度财务核心数据
  2. 区分营收、利润、毛利率、ROE、现金流
  3. 标出改善 / 恶化 / 波动点
  4. 说明累计值、单季值、同比口径
Applicable to:
  • Check XX's financial report
  • Profit trends in recent quarters
  • How is the financial quality?
Default workflow:
  1. Retrieve core financial data for the latest 8 quarters + latest annual report
  2. Distinguish between revenue, profit, gross profit margin, ROE, cash flow
  3. Mark improvement / deterioration / volatility points
  4. Explain cumulative values, single-quarter values, year-over-year calibers

4. 估值分析 / 筛选

4. Valuation Analysis / Screening

适用:
  • 现在估值高不高
  • 谁更便宜
  • 筛低估值高股息
默认流程:
  1. 明确标的池
  2. daily_basic
    等估值指标
  3. 必要时联动财务质量
  4. 输出排序、极值、口径说明
Applicable to:
  • Is the current valuation high?
  • Which is cheaper?
  • Screen for low valuation and high dividend yield
Default workflow:
  1. Clarify the target pool
  2. Retrieve valuation indicators like
    daily_basic
  3. Link with financial quality if necessary
  4. Output rankings, extreme values, and caliber explanations

5. 资金流追踪

5. Capital Flow Tracking

适用:
  • 最近资金在买什么
  • 北向最近流向哪里
  • 主力资金流入最多的是谁
默认流程:
  1. 明确资金口径(北向 / 主力 / 龙虎榜 / 板块资金)
  2. 确定时间窗
  3. 拉净流入 / 活跃成交 / 持续性
  4. 和价格表现联动解释
  5. 避免把单日噪声说成趋势
Applicable to:
  • What are funds buying recently?
  • Where are northbound funds flowing lately?
  • Which stocks have the largest main capital inflows?
Default workflow:
  1. Clarify the capital caliber (northbound / main / Dragon & Tiger List / sector capital)
  2. Determine the time window
  3. Retrieve net inflow / active trading / sustainability
  4. Link with price performance for interpretation
  5. Avoid treating single-day noise as a trend

6. 板块 / 题材轮动分析

6. Sector / Theme Rotation Analysis

适用:
  • 最近哪个板块最强
  • 机器人最近强在哪
  • 某概念板块里有哪些成分股
默认流程:
  1. 确定分类口径
  2. 拉板块区间表现
  3. 必要时联动成分股、资金流、涨停梯队
  4. 输出强势板块排行与代表标的
Applicable to:
  • Which sector is the strongest recently?
  • Why are robot stocks performing strongly?
  • What are the components of this concept sector?
Default workflow:
  1. Determine the classification caliber
  2. Retrieve sector interval performance
  3. Link with components, capital flows, price limit ladder if necessary
  4. Output rankings of strong sectors and representative targets

7. 公告 / 新闻 / 事件梳理

7. Announcement / News / Event Organization

适用:
  • 最近有什么公告
  • 有没有什么催化
  • 最近新闻面怎么样
默认流程:
  1. 明确对象和时间窗
  2. 拉公告 / 新闻 / 研报 / 政策数据
  3. 去噪,提炼 3~5 条主线
  4. 区分事实、公告、媒体解读
  5. 必要时结合股价异动做弱因果解释
Applicable to:
  • What announcements have been released recently?
  • Are there any catalytic events?
  • How is the news sentiment lately?
Default workflow:
  1. Clarify the target and time window
  2. Retrieve announcement / news / research report / policy data
  3. Remove noise and extract 3~5 main themes
  4. Distinguish between facts, announcements, and media interpretations
  5. Combine with stock price fluctuations for weak causal interpretation if necessary

8. 数据导出与研究准备

8. Data Export & Research Preparation

适用:
  • 拉一份 CSV
  • 做回测数据表
  • 导出某段时间的行情/财务数据
默认流程:
  1. 明确数据范围、频率、字段
  2. 采用分段策略取数
  3. 清洗、去重、统一字段类型
  4. 输出 CSV / parquet
  5. 给出文件路径和元信息
Applicable to:
  • Pull a CSV report
  • Create a backtesting data table
  • Export market/financial data for a specific period
Default workflow:
  1. Clarify data scope, frequency, and fields
  2. Use a segment retrieval strategy
  3. Clean, deduplicate, and unify field types
  4. Output to CSV / parquet
  5. Provide the file path and metadata

9. 综合研究简报

9. Comprehensive Research Brief

适用:
  • 给我快速研究一下 XX
  • 做个投资者视角简报
  • 先给个全景判断
默认流程:
  1. 一句话结论
  2. 行情表现
  3. 财务趋势
  4. 估值水平
  5. 资金流情况
  6. 公告 / 新闻催化
  7. 风险点
  8. 值得继续深挖的问题

Applicable to:
  • Give me a quick analysis of XX
  • Create an investor perspective brief
  • Give a panoramic judgment first
Default workflow:
  1. One-sentence conclusion
  2. Market performance
  3. Financial trends
  4. Valuation level
  5. Capital flow situation
  6. Announcement / news catalysts
  7. Risk points
  8. Issues worth further exploration

Data quality rules

Data quality rules

拉取完成后,至少做这些检查:
  • schema 校验
  • 关键字段存在性检查
  • 主键去重
  • 固定排序
  • 日期标准化
  • 数值字段类型规范化
After retrieval, perform at least these checks:
  • Schema validation
  • Key field existence check
  • Primary key deduplication
  • Fixed sorting
  • Date standardization
  • Numeric field type normalization

空结果处理

Empty Result Handling

空表不一定是失败,要区分:
  • 非交易日
  • 区间无数据
  • 股票未上市
  • 参数错误
  • 接口权限不足
不要把所有空结果都说成“接口坏了”。

An empty table doesn't always mean failure; distinguish between:
  • Non-trading day
  • No data in the interval
  • Stock not listed yet
  • Parameter error
  • Insufficient interface permissions
Don't claim "the interface is broken" for all empty results.

Cache and reuse rules

Cache and reuse rules

为了让 skill 可长期复用,应优先支持:
  • 基础表缓存(如
    stock_basic
    、交易日历、指数基础信息)
  • 增量更新,而不是每次全量重拉
  • 大任务断点续跑
  • 结果文件规范命名
推荐命名格式:
  • daily_600519.SH_20230101_20231231_20260322.csv
  • fina_indicator_300750.SZ_20260322.parquet
缓存命中时,最好说明哪些来自缓存,哪些是新拉取的数据。

To make the skill reusable long-term, prioritize supporting:
  • Basic table caching (e.g.,
    stock_basic
    , trading calendar, index basic information)
  • Incremental updates instead of full re-retrieval every time
  • Breakpoint resumption for large tasks
  • Standardized naming of result files
Recommended naming format:
  • daily_600519.SH_20230101_20231231_20260322.csv
  • fina_indicator_300750.SZ_20260322.parquet
When cache is hit, it's best to explain which data comes from cache and which is newly retrieved.

Error handling

Error handling

优先用“人话 + 调试细节分层”的方式输出错误。
Prioritize outputting errors in a "plain language + layered debugging details" format.

用户可见层

User-Visible Layer

  • token 未配置
  • 当前接口可能需要更高积分/权限
  • 时间范围过大,已自动改为分段拉取
  • 股票名称不唯一,请确认是哪一个
  • 当前结果为空,可能因为该日期非交易日 / 标的未上市 / 无权限
  • Token not configured
  • Current interface may require higher points/permissions
  • Time range is too large, automatically adjusted to segment retrieval
  • Stock name is not unique, please confirm which one it is
  • Current result is empty, possibly due to non-trading day / target not listed / insufficient permissions

调试层

Debug Layer

必要时补:
  • 接口名
  • 参数
  • 失败分段
  • 异常原文
Supplement if necessary:
  • Interface name
  • Parameters
  • Failed segments
  • Original exception text

部分成功原则

Partial Success Principle

如果部分分段失败,不要说“成功完成”。 应明确说:
  • 哪些部分成功
  • 哪些部分失败
  • 是否已生成不完整结果

If some segments fail, don't say "completed successfully". Clearly state:
  • Which parts succeeded
  • Which parts failed
  • Whether an incomplete result has been generated

Recommended minimal interface set

Recommended minimal interface set

主 skill 正文不要塞几百个接口。 优先记住 80% 常用任务的核心接口集:
  • stock_basic
  • trade_cal
  • daily
  • pro_bar
  • daily_basic
  • fina_indicator
  • income
  • balancesheet
  • cashflow
  • forecast
  • express
  • moneyflow
  • moneyflow_hsgt
  • hsgt_top10
  • top_list
  • index_basic
  • index_daily
  • index_classify
  • sw_daily
  • ths_index
  • ths_member
  • limit_list_d
  • limit_step
  • news
  • major_news
  • research_report
  • anns_d
  • cn_cpi
  • cn_pmi
  • us_tycr
全部数据接口,请参考
references/数据接口.md

Don't stuff hundreds of interfaces into the main skill. Prioritize remembering the core interface set for 80% of common tasks:
  • stock_basic
  • trade_cal
  • daily
  • pro_bar
  • daily_basic
  • fina_indicator
  • income
  • balancesheet
  • cashflow
  • forecast
  • express
  • moneyflow
  • moneyflow_hsgt
  • hsgt_top10
  • top_list
  • index_basic
  • index_daily
  • index_classify
  • sw_daily
  • ths_index
  • ths_member
  • limit_list_d
  • limit_step
  • news
  • major_news
  • research_report
  • anns_d
  • cn_cpi
  • cn_pmi
  • us_tycr
For all data interfaces, refer to
references/数据接口.md
.

Best practices

Best practices

  • 先理解任务,再选接口
  • 能少取就少取,先核心数据,再扩展
  • 先给结论,再给证据
  • 默认说人话,不堆字段名
  • 对“最近 / 财报 / 强不强 / 资金关注”这类模糊中文表达,要有合理默认口径
  • 大任务先给执行计划,再开跑
  • 导出任务尽量保留脚本、元信息、文件路径,方便复用

  • First understand the task, then select interfaces
  • Retrieve only necessary data, start with core data then expand
  • Provide conclusions first, then evidence
  • Default to plain language, don't stack field names
  • Have reasonable default calibers for vague Chinese expressions like "recently / financial report / strong or not / capital attention"
  • For large tasks, provide an execution plan first before starting
  • For export tasks, try to retain scripts, metadata, and file paths for easy reuse

Examples

Examples

单票行情

Single Stock Market Analysis

  • 看下宁德时代最近三个月走势
  • 茅台今年以来涨了多少
  • 招行这两年最大回撤大概多少
  • Check the performance of CATL in the past three months
  • How much has Moutai risen since the beginning of the year?
  • What's the maximum drawdown of China Merchants Bank in the past two years?

财务 / 估值

Finance / Valuation

  • 看下比亚迪最近 8 个季度营收和净利润趋势
  • 茅台现在估值算高吗
  • 帮我找高 ROE 低负债的公司
  • Check the revenue and net profit trends of BYD in the latest 8 quarters
  • Is Moutai's current valuation high?
  • Help me find companies with high ROE and low debt

对比

Comparison

  • 比一下茅台、五粮液、泸州老窖近一年的涨幅和估值
  • 对比一下沪深300、中证500、创业板今年表现
  • Compare the annual gains and valuations of Moutai, Wuliangye, and Luzhou Laojiao
  • Compare the performance of CSI 300, CSI 500, and ChiNext this year

资金流 / 板块

Capital Flows / Sectors

  • 今天北向资金流入最多的股票有哪些
  • 最近哪个板块最强
  • 半导体板块最近一个月强不强
  • Which stocks have the largest northbound fund inflows today?
  • Which sector is the strongest recently?
  • How has the semiconductor sector been performing in the past month?

公告 / 事件

Announcements / Events

  • 帮我梳理下寒武纪最近的重要公告
  • 最近机器人板块有什么消息面催化
  • Help me organize important recent announcements of Cambricon
  • What news catalysts are there for the robot sector lately?

宏观

Macroeconomics

  • 看一下最近 CPI、PPI、PMI 变化
  • 当前市场风格偏成长还是价值
  • Check the recent changes in CPI, PPI, and PMI
  • Is the current market style leaning towards growth or value?

导出

Export

  • 把沪深300成分股近两年日线导成 CSV
  • 下载宁德时代 2020 到现在的复权行情
  • 把最近 3 年 ROE、PE、PB、营收增速拉成一个表

  • Export the daily data of CSI 300 components in the past two years to CSV
  • Download the adjusted market data of CATL from 2020 to now
  • Pull a table of ROE, PE, PB, and revenue growth rate for the past 3 years

Quick rule

Quick rule

当用户在说:
  • 看走势
  • 查财报
  • 比较公司
  • 看板块
  • 看资金流
  • 梳理公告新闻
  • 看宏观
  • 拉数据导出
就不要先想“有哪些接口”。 先想: 这是什么任务?默认该走哪条数据工作流?结果应该怎样交付才真正有用?
When the user is saying:
  • Check performance trends
  • Look up financial reports
  • Compare companies
  • Analyze sectors
  • Track capital flows
  • Organize announcements & news
  • Analyze macroeconomics
  • Pull and export data
Don't first think "what interfaces are there". First think: What task is this? Which data workflow should be followed by default? How should the results be delivered to be truly useful?