financial-data-analysis
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese📊 金融时间序列分析工具箱
📊 Financial Time Series Analysis Toolkit
覆盖股票 / 商品期货 / 加密货币 / ETF / 外汇 / 指数的综合数据分析方法工具箱。
A comprehensive data analysis method toolkit covering stocks / commodity futures / cryptocurrencies / ETFs / foreign exchange / indices.
数据获取策略
Data Acquisition Strategy
| 资产类型 | 数据源 | 方式 |
|---|---|---|
| A股行情/财务/指数 | Tushare MCP | |
| A股期货 | Tushare MCP | |
| 港股/美股 | Tushare MCP | |
| 宏观经济 | Tushare MCP | |
| 国际商品期货(WTI/黄金等) | yfinance | |
| 加密货币 | yfinance | |
| 外汇 | Tushare MCP 或 yfinance | 视具体币种 |
| 全球指数 | Tushare MCP 或 yfinance | |
规则:调用 tushare MCP tool 前必须先加载。 tushare tool 完整索引见ToolSearch("+tushare <关键词>")skill 的stock-tushare-pro-mcp。reference/tool-index.md
| Asset Type | Data Source | Method |
|---|---|---|
| A-share market/finance/index | Tushare MCP | |
| A-share futures | Tushare MCP | |
| Hong Kong stocks/US stocks | Tushare MCP | |
| Macroeconomics | Tushare MCP | |
| International commodity futures (WTI/gold etc.) | yfinance | |
| Cryptocurrency | yfinance | |
| Foreign exchange | Tushare MCP or yfinance | Depending on specific currency |
| Global indices | Tushare MCP or yfinance | |
Rule: You must first load withbefore calling the tushare MCP tool. The full index of tushare tools can be found inToolSearch("+tushare <keyword>")of thereference/tool-index.mdskill.stock-tushare-pro-mcp
分析方法路由
Analysis Method Routing
根据用户意图,阅读对应 文档后执行分析:
references/methods/| 用户意图关键词 | 参考文档 | 可用脚本 |
|---|---|---|
| 平稳性、趋势检验、序列分解、结构断裂、Hurst | | |
| 价格预测、ARIMA、Prophet、VAR | | |
| 相关性、协整、因果关系、领先滞后 | | |
| 波动率、GARCH、VaR、尾部风险 | | |
| 组合优化、因子分析、风险平价、有效前沿 | | |
| 市场状态、regime、周期、小波 | | |
| 商品季节性、价差、期限结构、contango | | |
| 网络分析、信息流、聚类、MST | | |
| 技术指标(MA/RSI/MACD/KDJ/布林带) | | |
| 图表绘制、可视化 | | — |
| 报告格式 | | — |
According to user intent, read the corresponding documentation before performing analysis:
references/methods/| User Intent Keywords | Reference Document | Available Scripts |
|---|---|---|
| Stationarity, trend test, series decomposition, structural break, Hurst | | |
| Price forecast, ARIMA, Prophet, VAR | | |
| Correlation, cointegration, causality, lead-lag | | |
| Volatility, GARCH, VaR, tail risk | | |
| Portfolio optimization, factor analysis, risk parity, efficient frontier | | |
| Market state, regime, cycle, wavelet | | |
| Commodity seasonality, spread, term structure, contango | | |
| Network analysis, information flow, clustering, MST | | |
| Technical indicators (MA/RSI/MACD/KDJ/Bollinger Bands) | | |
| Chart drawing, visualization | | — |
| Report format | | — |
执行流程
Execution Process
1. 识别用户意图 → 查上方路由表
2. 读取对应 references/methods/ 文档 → 选择合适方法
3. 获取数据:tushare MCP tool(优先)或 scripts/data_fetcher.py
4. 执行分析:scripts/analysis_toolkit.py 或 scripts/indicators.py
5. 生成图表:参照 references/visualization_cookbook.md
6. 输出报告:按 references/output_templates.md 格式1. Identify user intent → Check the routing table above
2. Read the corresponding references/methods/ document → Select appropriate method
3. Acquire data: tushare MCP tool (priority) or scripts/data_fetcher.py
4. Perform analysis: scripts/analysis_toolkit.py or scripts/indicators.py
5. Generate charts: Refer to references/visualization_cookbook.md
6. Output report: Follow references/output_templates.md format约束
Constraints
MUST
MUST
- 标注数据获取时间和来源(tushare / yfinance)
- 每份报告附免责声明
- 分析前检查序列平稳性(适用时)
- 异常值标注和处理
- Mark data acquisition time and source (tushare / yfinance)
- Attach a disclaimer to each report
- Check series stationarity before analysis (when applicable)
- Outlier marking and processing
MUST NOT
MUST NOT
- ❌ 给出确定性收益承诺
- ❌ 伪造或编造数据
- ❌ 忽略风险提示
- ❌ 数据缺失时猜测关键指标
- ❌ Give deterministic return commitments
- ❌ Forge or fabricate data
- ❌ Ignore risk warnings
- ❌ Guess key indicators when data is missing
输出存储规范
Output Storage Specification
输出目录
Output Directory
默认根目录为 (由 input-variables 配置,默认 )。
{output_dir}{workspace}/data/analysis/{output_dir}/
├── reports/ # 分析报告 (.md)
├── charts/ # 图表文件 (.png)
├── datasets/ # 中间数据集 (.csv)
└── temp/ # 临时数据(可清理)The default root directory is (configured by input-variables, default ).
{output_dir}{workspace}/data/analysis/{output_dir}/
├── reports/ # Analysis reports (.md)
├── charts/ # Chart files (.png)
├── datasets/ # Intermediate datasets (.csv)
└── temp/ # Temporary data (can be cleaned up)文件命名
File Naming
{类型}_{标的}_{日期}.{格式}示例:
report_CU_20260306.mdchart_AAPL_seasonal_20260306.pngdataset_corr_matrix_20260306.csv
{type}_{underlying}_{date}.{format}Examples:
report_CU_20260306.mdchart_AAPL_seasonal_20260306.pngdataset_corr_matrix_20260306.csv
输出规则
Output Rules
| 数据量 | 处理方式 |
|---|---|
| < 20 行 | 直接在对话中展示,不存文件 |
| >= 20 行 | 存入 |
| 图表 | 存入 |
| 分析报告 | 存入 |
| 临时/中间数据 | 存入 |
与 tushare skill 协作:原始行情数据存储遵循 tushare skill 的规范(output-storage.md), 本 skill 的{workspace}/data/tushare/只存分析结果,不存原始数据,避免重复。{output_dir}
| Data Volume | Processing Method |
|---|---|
| < 20 rows | Display directly in the conversation, no file storage |
| >= 20 rows | Store in |
| Charts | Store in |
| Analysis reports | Store in |
| Temporary/intermediate data | Store in |
Collaboration with tushare skill: Original market data storage follows thespecification of the tushare skill (output-storage.md), The{workspace}/data/tushare/of this skill only stores analysis results, not original data, to avoid duplication.{output_dir}
参数使用
Parameter Usage
所有可配置参数通过 声明,AI 在执行时按如下优先级获取值:
input-variables- 用户在对话中明确指定 -> 最高优先
- 中的
input-variables值 -> 兜底default
undefinedAll configurable parameters are declared through , and AI obtains values according to the following priority when executing:
input-variables- Explicitly specified by the user in the conversation -> Highest priority
- value in
default-> Fallbackinput-variables
undefined用户说 "把分析结果存到 ~/Desktop/analysis"
User says "save the analysis results to ~/Desktop/analysis"
-> output_dir = ~/Desktop/analysis
-> output_dir = ~/Desktop/analysis
用户说 "分析铜价"
User says "analyze copper prices"
-> output_dir = {workspace}/data/analysis (使用默认值)
-> default_period = 1y (使用默认值)
undefined-> output_dir = {workspace}/data/analysis (use default value)
-> default_period = 1y (use default value)
undefined