Quant Expert
Use this skill for Chinese A-share quantitative work in OpenClaw.
OpenClaw Setup
OpenClaw-friendly rule:
- - Keep the Tushare token outside the repository.
- Prefer OpenClaw config injection over manual shell export.
- Do not auto-install Python packages.
Recommended OpenClaw config:
CODEBLOCK0
Because primaryEnv is set to TUSHARE_TOKEN, OpenClaw can inject the token for this skill automatically.
Required Python packages for Tushare features:
- - INLINECODE2
- INLINECODE3
- INLINECODE4
Note:
- -
holiday_helper.py does not need TUSHARE_TOKEN. - All other bundled scripts need
TUSHARE_TOKEN.
Hard Rules
- 1. If dependencies or
TUSHARE_TOKEN are missing, stop and report the blocker clearly. - Do not install packages unless the user explicitly asks.
- Use Tushare as the primary numeric data source.
- Only add web research when the user wants interpretation, diagnosis, ranking, or recommendation.
- If Tushare is blocked, report the blocker instead of silently replacing numeric facts with web data.
Path Rule
When referencing bundled files in OpenClaw, use {baseDir}:
- - INLINECODE10
- INLINECODE11
- INLINECODE12
- INLINECODE13
- INLINECODE14
- INLINECODE15
What To Use
Raw Tushare query
Use {baseDir}/scripts/tushare_helper.py.
Example:
CODEBLOCK1
Stock screening
Use {baseDir}/scripts/stock_screener.py.
- -
value: low PE_TTM, low PB, minimum market cap, minimum ROE, exclude ST - INLINECODE22 : minimum
dv_ttm, then verify consecutive dividend years - INLINECODE24 : revenue YoY, profit YoY, and INLINECODE25
- INLINECODE26 : daily gain, volume ratio, turnover rate
Example:
CODEBLOCK2
Stock diagnosis
Use {baseDir}/scripts/stock_diagnosis.py.
Current built-in diagnosis is a structured snapshot, not an automatic rating model.
It covers:
- - company basics
- price performance
- valuation snapshot
- income and financial-indicator trends
- top shareholders and holder-count trend
- recent money flow
- ST, pledge, and restricted-share checks
Example:
CODEBLOCK3
Trading day and holiday
Use {baseDir}/scripts/holiday_helper.py.
Example:
CODEBLOCK4
Beijing Time Rule
Always reason in Beijing time.
- - Before 15:30 Beijing time, daily market data usually means the previous trading day.
- After 15:30 Beijing time, same-day daily data may be available.
- Do not hardcode dates when the helper utilities can derive them.
OpenClaw Execution Pattern
If the user wants raw data
- - Stay on the Tushare data layer.
- Use one bundled script first.
- Return concise results without forcing event research.
If the user wants judgment or interpretation
- 1. Pull numeric evidence with Tushare first.
- Add event evidence from credible web sources.
- Keep the final answer in this order:
1. one-line conclusion
2. key quantitative findings
3. key event findings with source and URL
4. resonance or divergence
5. main risks
6. investment disclaimer
Minimum event evidence target:
- - 2 stock-level events
- 2 industry-level events
- 2 macro/global events
References
- - INLINECODE29
- INLINECODE30
量化专家
在OpenClaw中用于中国A股量化工作。
OpenClaw配置
OpenClaw友好规则:
- - 将Tushare令牌保存在仓库外部。
- 优先使用OpenClaw配置注入,而非手动shell导出。
- 不要自动安装Python包。
推荐的OpenClaw配置:
json
{
skills: {
entries: {
quant-expert: {
apiKey: your-tushare-token
}
}
}
}
由于primaryEnv设置为TUSHARE_TOKEN,OpenClaw可以自动为该技能注入令牌。
Tushare功能所需的Python包:
注意:
- - holidayhelper.py不需要TUSHARETOKEN。
- 所有其他捆绑脚本都需要TUSHARE_TOKEN。
硬性规则
- 1. 如果缺少依赖项或TUSHARE_TOKEN,则停止并明确报告障碍。
- 除非用户明确要求,否则不要安装包。
- 使用Tushare作为主要数值数据源。
- 仅当用户需要解释、诊断、排名或推荐时,才添加网络研究。
- 如果Tushare被屏蔽,报告障碍,而不是用网络数据静默替换数值事实。
路径规则
在OpenClaw中引用捆绑文件时,使用{baseDir}:
- - {baseDir}/scripts/tusharehelper.py
- {baseDir}/scripts/stockscreener.py
- {baseDir}/scripts/stockdiagnosis.py
- {baseDir}/scripts/holidayhelper.py
- {baseDir}/references/apiquickreference.md
- {baseDir}/references/analysis_strategies.md
使用内容
原始Tushare查询
使用{baseDir}/scripts/tushare_helper.py。
示例:
bash
python {baseDir}/scripts/tusharehelper.py stockbasic {list_status:L} -n 20
python {baseDir}/scripts/tusharehelper.py dailybasic {tradedate:20260302} -f tscode,pettm,pb,totalmv
股票筛选
使用{baseDir}/scripts/stock_screener.py。
- - value:低PETTM、低PB、最小市值、最小ROE、排除ST
- dividend:最小dvttm,然后验证连续分红年份
- growth:营收同比增长、利润同比增长和ROE
- momentum:日涨幅、量比、换手率
示例:
bash
python {baseDir}/scripts/stock_screener.py -s value --pe-max 20 --roe-min 15 --mv-min 100
python {baseDir}/scripts/stock_screener.py -s growth --rev-growth-min 20 --profit-growth-min 25
股票诊断
使用{baseDir}/scripts/stock_diagnosis.py。
当前内置诊断是结构化快照,而非自动评级模型。
涵盖内容:
- - 公司基本信息
- 价格表现
- 估值快照
- 收入和财务指标趋势
- 前十大股东和股东户数趋势
- 近期资金流向
- ST、质押和限售股检查
示例:
bash
python {baseDir}/scripts/stock_diagnosis.py 600519.SH
交易日和节假日
使用{baseDir}/scripts/holiday_helper.py。
示例:
bash
python {baseDir}/scripts/holiday_helper.py check
python {baseDir}/scripts/holiday_helper.py next 2026-09-30
北京时间规则
始终以北京时间进行推理。
- - 北京时间15:30之前,每日市场数据通常指前一个交易日。
- 北京时间15:30之后,当日每日数据可能可用。
- 当辅助工具可以推导出日期时,不要硬编码日期。
OpenClaw执行模式
如果用户想要原始数据
- - 停留在Tushare数据层。
- 首先使用一个捆绑脚本。
- 返回简洁结果,不强制进行事件研究。
如果用户想要判断或解释
- 1. 首先使用Tushare提取数值证据。
- 从可信网络来源添加事件证据。
- 最终答案按以下顺序呈现:
1. 一行结论
2. 关键量化发现
3. 关键事件发现(附来源和URL)
4. 共振或分歧
5. 主要风险
6. 投资免责声明
最低事件证据目标:
- - 2个股票层面事件
- 2个行业层面事件
- 2个宏观/全球层面事件
参考资料
- - {baseDir}/references/apiquickreference.md
- {baseDir}/references/analysis_strategies.md