Trading_Agents_for_Futures
期货六维分析数据引擎。两种运行模式: (1) 数据模式:python main.py -s RB → 结构化 JSON 指标 + data_gap_report(数据缺口报告 + AI 搜索指令) (2) 决策模式:python main.py -s RB --decision → 指标 + 数据来源追溯 + 多... Skill: Trading_Agents_for_Futures Owner: haoge10241024 Summary: 期货六维分析数据引擎。两种运行模式: (1) 数据模式:python main.py -s RB → 结构化 JSON 指标 + data_gap_report(数据缺口报告 + AI 搜索指令) (2) 决策模式:python main.py -s RB --decision → 指标 + 数据来源追溯 + 多... Tags: latest:2.0.19 Version history: v2.0.19 | 2026-05-22T09:02:56.522Z | user No code or documentation changes detected in this version. - No updates or modifications found in any files. - SKILL
Rank
62
Safety
84
Downloads
1.8k
Updated
Oct 10, 2026
Version
2.0.19
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.8K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 10, 2026
- Adoption signal
- 1.8K downloadsadoption · observed Oct 10, 2026
- Latest release
- 2.0.19release · observed May 22, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s17bnzy7mnzycecdrznmm1ptnh86sage:trading-agents-for-futures- Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-haoge10241024-trading-agents-for-futures/snapshot"
Documentation
CLAWHUB
154,880 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: Trading_Agents_for_Futures
description: |
期货六维分析数据引擎。两种运行模式:
(1) 数据模式:python main.py -s RB → 结构化 JSON 指标 + data_gap_report(数据缺口报告 + AI 搜索指令)
(2) 决策模式:python main.py -s RB --decision → 指标 + 数据来源追溯 + 多空辩论 + 风控 + CIO决策报告
零 API Key,纯规则引擎。API 缺失时自动生成 search_actions,AI Agent 可按 fillability 回填 ai_fill 槽位。
agent_created: true
---
# Trading_Agents_for_Futures — 期货分析数据引擎
> **你是哪种用户?根据你的身份选择对应模式。**
| 如果你 | 用这个命令 | 你会得到 |
|--------|-----------|---------|
| **是 AI Agent**(Kimi/Claude/GPT-4 等),需要结构化数据自己分析判断 | `python main.py -s RB` | 纯指标 JSON(MA/MACD/RSI/Z-score/净持仓...),无方向判断 |
| **是人类交易者**,需要直接看"多空辩论报告 + 操作建议" | `python main.py -s RB --decision` | 指标数据 + 口语化多空辩论 + 裁判长裁决 + 仓位/止损建议 |
---
## 快速开始
```bash
# 默认:数据模式(给 AI Agent 用)
python main.py -s RB
# 决策模式:辩论 + 风控 + CIO 建议(给人类看)
python main.py -s RB --decision
# 批量分析多个品种
python main.py -s RB,CU,M
# 全市场扫描 38 个品种
python main.py -s ALL
```
执行后输出纯 JSON(字段含义见下文)。首次运行会自动下载约 1 年历史数据,耗时 5~10 分钟;后续秒级。
---
## 输出 JSON 结构
```json
{
"symbol": "RB",
"timestamp": "2026-05-14T15:43:59",
"success": true,
"analysis_details": {
"technical_analysis": {
"close": 3257.0,
"MA5": 3266.8,
"MA20": 3192.1,
"MA60": 3131.7,
"EMA20": 3207.3,
"MACD": 37.8,
"MACD_Signal": 30.8,
"MACD_Hist": 7.0,
"RSI14": 70.5,
"BB_Upper": 3312.0,
"BB_Middle": 3192.1,
"BB_Lower": 3072.1,
"ATR14": 30.2,
"VOL_MA20": 685669,
"OI_delta": -49216,
"trend_20d": "up",
"change_20d_pct": 5.1,
"data_points": 245
},
"basis_analysis": {
"spot_price": 3280.0,
"futures_price": 3260.0,
"current_basis": -20.0,
"basis_pct": -0.6,
"basis_zscore_180d": -0.8,
"structure": "backwardation"
},
"term_structure_analysis": {
"front_contract": "RB2605",
"back_contract": "RB2704",
"front_price": 3150,
"back_price": 3307,
"spread": 157,
"spread_pct": 5.0,
"structure": "contango"
},
"inventory_analysis": {
"latest_inventory": 520000,
"inv_change_wow": 0.7,
"inv_change_mom": -2.3,
"inv_zscore_180d": 1.6,
"latest_warehouse_receipt": 82000,
"wr_change_5d": 1500
},
"positioning_analysis": {
"net_position": -3367,
"net_change": -3466,
"concentration_idx": 0.0068,
"top20_long": 245143,
"top20_short": 241185,
"top20_long_pct": 0.5041,
"top20_members_count": 20
},
"news_analysis": {
"total_news_count": 10,
"bullish_news_count": 1,
"bearish_news_count": 0,
"neutral_news_count": 9,
"sentiment_ratio": 0.1
}
}
}
```
> **输出是纯指标字典,不含任何方向判断、置信度评分、辩论文本。**
> 每个 skill 的本地规则逻辑(`_rule_based_signal`)仍在内部运行但不对外暴露。
---
## 六大分析维度 & 方法论框架
**你是 AI 分析师,以下是你可以用来解读数据的完整方法论。**
---
### 一、技术面分析 (`technical_analysis`)
**数据指标:** close, MA5/MA20/MA60, EMA20, MACD/Signal/Hist, RSI14, BB_Upper/Middle/Lower, ATR14, VOL_MA20, OI_delta, trend_20d, cREADME.md
# Trading_Agents_for_Futures
> 期货六维分析数据引擎 — 纯规则引擎,零 API Key 依赖。通过 AkShare 从公开数据源获取行情,覆盖 48 个期货品种。
## 两种使用模式
| 模式 | 命令 | 适合谁 | 输出 |
|------|------|--------|------|
| **数据模式**(默认) | `python main.py -s RB` | AI Agent / 量化程序 | 纯指标 JSON + 数据缺口报告,不做方向判断 |
| **决策模式** | `python main.py -s RB --decision` | 人类交易者 | 指标 + 数据来源追溯 + 口语化多空辩论 + 风控 + CIO 仓位建议 |
## 快速开始
```bash
python main.py -s RB # 数据模式:纯指标 JSON
python main.py -s RB --decision # 决策模式:辩论 + 风控 + CIO 建议
python main.py -s RB,CU,M # 批量分析
python main.py -s ALL # 全市场扫描 48 个品种
python main.py -s RB -o out.json # 额外输出到文件
```
首次运行自动下载约 1 年历史数据(基差模块约 5~10 分钟),后续运行秒级。
## 六维分析能力
| 分析模块 | 计算指标 | 数据来源 |
|---------|---------|---------|
| 技术面分析 | MA5/20/60, EMA20, MACD+Signal+Hist, RSI14, BB, ATR14, 量仓 | 新浪财经 |
| 基差分析 | 现货-期货基差, 基差率, 季节性Z-score, 斜率, Contango/Backwardation | 100ppi.com |
| 期限结构 | 合约价差, 展期结构, spread%, contango/backwardation | AkShare 多策略 |
| 库存仓单 | 库存量, 周/月变化率, 季节性Z-score, 仓单量 | 东方财富 |
| 持仓席位 | 净持仓, 净持仓变化, 加权HHI集中度, 前20多空比, 关键席位追踪 | 三大交易所 |
| 新闻情绪 | 48 词关键词匹配, 利多/利空/中性计数, 情绪比率 | 上海金属网 |
## API 失效时的处理
当数据接口(AkShare)在周末/节假日/不可用时,系统**不会**静默失败:
| 策略 | 说明 |
|------|------|
| **30 天回退** | 逐日回溯找最近的交易日数据,跳过周末 |
| **过期缓存兜底** | 在线 API 全部失败后自动使用本地历史缓存 |
| **Zip 损坏精准清除** | 遇到 AkShare 缓存损坏时按需清理,不滥杀合法缓存 |
| **数据缺口报告** | `coverage` 如实统计可用维度,`data_gap_report` 列出每个缺失维度的 `search_actions`(AI 搜索指令) |
| **AI Fill 槽位** | 每个维度预留 `ai_fill` 字段,AI Agent 搜索后可按 `fillability` 分级回填(`fillable` 正常参与评分,`direction_only` 降权参与) |
## 核心特色
- **零 API Key:** 不调 LLM,纯规则引擎。装完即用,只需要网络(AkShare 下载行情)。
- **四维动态权重:** 品种品类 × 置信度 Sigmoid × 市场状态自适应 × 数据质量折损
- **数据诚实:** `coverage` 从不虚报,缺失维度追加 `warning_flags` + `data_gap_report`
- **信号校正:** 持仓口径矛盾交叉验证、基差斜率×结构矛盾检测、回退数据自动降权
- **永不 null:** 止损止盈始终有值(ATR 动态计算 → 固定值兜底)
- **48 品种覆盖:** Sina 映射 + 品类分类完整,JD/EG/LC/SI 等小品种无遗漏
## 输出结构
数据模式输出的 JSON 包含:
```
{
"symbol": "JD",
"coverage": {"total": 6, "available": 4, "missing": ["positioning_analysis", "term_structure_analysis"]},
"analysis_details": { ... 各维度指标 ... },
"warning_flags": [{ "skill": "term_structure_analysis", "search_actions": [...] }],
"data_gap_report": {
"total_gaps": 2,
"summary": {"fillable": 1, "direction_only": 1, "not_fillable": 0},
"gaps": [
{ "skill": "term_structure_analysis", "fillability": "direction_only",
"search_actions": [{"query": "JD 期货 期限结构 contango", "source": "web"}],
"ai_fill_schema": { "fields": ["structure"], "cannot_fill": ["prices", "spread_pct"] }
}
]
}
}
```
## 项目结构
```
Trading_Agents_for_Futures/
├── main.py # 命令行入口
├── manifest.yaml # Skill 元数据
├── requirements.txt # 7 个核心依赖
├── README.md # 本文件(人类阅读)
├── SKILL.md # 分析框架知识库 + AI Fill 模板(AI Agent 阅读)
├── setup.py # 自动安装依赖
├── config/
│ ├── core.yaml # 默认配置(数据源、风控、日志)
│ └── user.yaml # 用户覆盖
├── core/
│ ├── core_engine.py # 核心引擎 + 共享工具函数
│ └── data_utils.py # AkShare 数据获取(6 种数据类型 + 缓存管理)
└── skills/
_meta.json
{
"ownerId": "kn73gq4q850xmp0ja3xf085rvd83ckr4",
"slug": "trading-agents-for-futures",
"version": "2.0.19",
"publishedAt": 1779440576522
}skill-card.md
## Description: Trading_Agents_for_Futures analyzes futures markets across technical, basis, term structure, inventory, positioning, and news dimensions, returning structured JSON metrics and optional debate-style risk decision reports. This skill is ready for commercial/non-commercial use. ## Publisher: [haoge10241024](https://clawhub.ai/user/haoge10241024) ### License/Terms of Use: MIT-0 ## Use Case: External users, developers, and trading analysts use this skill to collect public futures-market signals, identify data gaps for agent-assisted follow-up, and generate structured indicators or decision-support reports. Outputs should be independently checked and not treated as investment advice. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: Dependency installation may modify the active Python environment. Mitigation: Install and run the skill in a virtual environment, avoid administrator/root execution, and review or pin dependencies before use. Risk: Market-data downloads, caches, and output files may contain stale, incomplete, or locally sensitive analysis artifacts. Mitigation: Verify data freshness independently and protect cache, output, and log locations according to the user's data-handling requirements. Risk: Decision-mode outputs can be mistaken for investment advice. Mitigation: Treat buy, sell, position, and risk outputs as decision-support material only and validate suitability with independent market and risk review. Risk: Proxy credentials or other sensitive configuration values could be exposed if placed in configuration or logs. Mitigation: Avoid storing credentials in config files for this skill; if proxy settings are required, protect logs and configuration files. ## Reference(s): - [ClawHub skill page](https://clawhub.ai/haoge10241024/skills/trading-agents-for-futures) - [README](artifact/README.md) - [Skill instructions](artifact/SKILL.md) - [Skill manifest](artifact/manifest.yaml) ## Skill Output: **Output Type(s):** [json, markdown, text, guidance] **Output Format:** [Structured JSON with optional Markdown-like decision reports and search-action guidance] **Output Parameters:** [1D] **Other Properties Related to Output:** [May include coverage, warning_flags, data_gap_report, and ai_fill slots for missing market data.] ## Skill Version(s): 2.0.19 (source: server release evidence) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
config/core.yaml
# ============================================================
# Trading_Agents_for_Futures - 默认配置文件
# 此文件包含系统所有默认配置项
# 用户可通过 config/user.yaml 覆盖任意配置
# ============================================================
# ── 项目基础设置 ──────────────────────────────────────────
project:
name: "Trading_Agents_for_Futures"
timezone: "Asia/Shanghai"
output_dir: "output"
cache_dir: "cache"
# ── 数据源配置 ────────────────────────────────────────────
data:
default_lookback_days: 365
rate_limit_per_sec: 4
retries: 3
timeout_sec: 30
use_cache: true
providers:
primary: "akshare"
fallback: "tushare"
# ── 默认品种列表 ──────────────────────────────────────────
symbols:
default:
- RB
- CU
- LH
- I
- MA
- M
# ── 风控参数 ──────────────────────────────────────────────
risk:
max_margin_ratio: 0.30
max_position_per_symbol: 0.20
allow_overnight: true
atr_stop_multiplier: 2.5
max_drawdown_tolerance: 0.15
risk_levels:
low:
max_position_pct: 0.20
stop_loss_pct: 0.02
medium:
max_position_pct: 0.12
stop_loss_pct: 0.03
high:
max_position_pct: 0.05
stop_loss_pct: 0.05
# ── 分析方法配置 ──────────────────────────────────────────
analysis:
engine: "rule_based"
dynamic_weights: true
# ── 日志配置 ──────────────────────────────────────────────
logging:
level: "INFO"
file: "output/run.log"AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/haoge10241024/skills/trading-agents-for-futures",
"sourceUrl": "https://clawhub.ai/haoge10241024/skills/trading-agents-for-futures",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T00:51:36.651Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-haoge10241024-trading-agents-for-futures/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-haoge10241024-trading-agents-for-futures/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T00:51:36.651Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.8K downloads",
"href": "https://clawhub.ai/haoge10241024/trading-agents-for-futures",
"sourceUrl": "https://clawhub.ai/haoge10241024/trading-agents-for-futures",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T00:51:36.651Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "2.0.19",
"href": "https://clawhub.ai/haoge10241024/trading-agents-for-futures",
"sourceUrl": "https://clawhub.ai/haoge10241024/trading-agents-for-futures",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-05-22T09:02:56.522Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-haoge10241024-trading-agents-for-futures/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-haoge10241024-trading-agents-for-futures/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 2.0.19",
"description": "No code or documentation changes detected in this version. - No updates or modifications found in any files. - SKILL.md content remains unchanged from the previous version.",
"href": "https://clawhub.ai/haoge10241024/trading-agents-for-futures",
"sourceUrl": "https://clawhub.ai/haoge10241024/trading-agents-for-futures",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-05-22T09:02:56.522Z",
"isPublic": true
}
]
}Record generated Oct 10, 2026.
