A comprehensive data analysis method toolbox covering stocks / commodity futures / cryptocurrencies / ETFs / forex / indices.
Data Acquisition Strategy
| Asset Type | Data Source | Method |
|---|---|---|
| A-share quotes/financials/indices | Tushare MCP | tushare_daily, tushare_income and other MCP tools |
| A-share futures | Tushare MCP | tushare_fut_daily, tushare_fut_holding etc. |
| Hong Kong stocks/US stocks | Tushare MCP | tushare_hk_daily, tushare_us_daily |
| Macroeconomics | Tushare MCP | tushare_cn_gdp, tushare_shibor etc. |
| International commodity futures (WTI/gold, etc.) | yfinance | scripts/data_fetcher.py |
| Cryptocurrencies | yfinance | scripts/data_fetcher.py |
| Forex | Tushare MCP or yfinance | depending on the specific currency pair |
| Global indices | Tushare MCP or yfinance | tushare_index_global / yfinance |
Rule: Before calling a tushare MCP tool, you must first
ToolSearch("+tushare <关键词>")load. For the complete index of tushare tools, seestock-tushare-pro-mcpskill'sreference/tool-index.md。
Analysis Method Routing
Based on user intent, read the corresponding references/methods/ document before performing the analysis:
| User intent keywords | Reference document | Available scripts |
|---|---|---|
| Stationarity, trend tests, series decomposition, structural breaks, Hurst | references/methods/01_time_series_fundamentals.md |
scripts/analysis_toolkit.py |
| Price forecasting, ARIMA, Prophet, VAR | references/methods/02_forecasting.md |
scripts/analysis_toolkit.py |
| Correlation, cointegration, causality, lead-lag | references/methods/03_cross_asset_relationships.md |
scripts/analysis_toolkit.py |
| Volatility, GARCH, VaR, tail risk | references/methods/04_volatility_and_risk.md |
scripts/analysis_toolkit.py |
| Portfolio optimization, factor analysis, risk parity, efficient frontier | references/methods/05_portfolio_and_factor.md |
scripts/analysis_toolkit.py |
| Market regime, regime, cycles, wavelets | references/methods/06_regime_and_structure.md |
scripts/analysis_toolkit.py |
| Commodity seasonality, spreads, term structure, contango | references/methods/07_commodity_specific.md |
scripts/analysis_toolkit.py |
| Network analysis, information flow, clustering, MST | references/methods/08_network_and_information.md |
scripts/analysis_toolkit.py |
| Technical indicators (MA/RSI/MACD/KDJ/Bollinger Bands) | references/methods/01_time_series_fundamentals.md |
scripts/indicators.py |
| Chart plotting, visualization | references/visualization_cookbook.md |
— |
| Report format | references/output_templates.md |
— |
Execution Workflow
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 格式
Constraints
MUST
- Label data acquisition time and source (tushare / yfinance)
- Attach a disclaimer to every report
- Check series stationarity before analysis (when applicable)
- Label and handle outliers
MUST NOT
- ❌ Make guaranteed return promises
- ❌ Fabricate or make up data
- ❌ Ignore risk warnings
- ❌ Guess key metrics when data is missing
Output Storage Specification
Output Directory
The default root directory is {output_dir}(configured by input-variables, default {workspace}/data/analysis/)。
{output_dir}/
├── reports/ # 分析报告 (.md)
├── charts/ # 图表文件 (.png)
├── datasets/ # 中间数据集 (.csv)
└── temp/ # 临时数据(可清理)
File Naming
{类型}_{标的}_{日期}.{格式}
Example:
report_CU_20260306.mdchart_AAPL_seasonal_20260306.pngdataset_corr_matrix_20260306.csv
Output Rules
| Data Volume | Handling Method |
|---|---|
| < 20 rows | Display directly in the conversation, do not save to a file |
| >= 20 rows | Save to datasets/, return the file path + summary |
| Charts | Save to charts/, display embedded in the conversation |
| Analysis report | Save to reports/, return the full report |
| Temporary/intermediate data | Save to temp/, remind the user that it can be cleaned up |
Collaborate with the tushare skill: Raw market data storage follows the tushare skill's
output-storage.mdspecification ({workspace}/data/tushare/), this skill's{output_dir}only stores analysis results, not raw data, to avoid duplication.
Parameter usage
All configurable parameters are declared via input-variables , and AI obtains values in the following priority order during execution:
- Explicitly specified by the user in the conversation -> highest priority
input-variablesindefaultvalue -> fallback
# 用户说 "把分析结果存到 ~/Desktop/analysis"
-> output_dir = ~/Desktop/analysis
# 用户说 "分析铜价"
-> output_dir = {workspace}/data/analysis (使用默认值)
-> default_period = 1y (使用默认值)