← 返回 Skills 市场
G2量化交易策略
作者
Austin0208
· GitHub ↗
· v1.0.0
· MIT-0
77
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install g2-trading-strategy
功能描述
基于21组策略回测,提供沪深300量化交易系统,年化收益21.2%,夏普率1.12,含智能选股和严格风控。
使用说明 (SKILL.md)
G2量化交易策略技能
基于21组策略回测验证的最优A股量化交易系统 版本: v6.0-g2-optimal | 回测收益: +26.7% | 夏普比率: 1.12
📋 技能概述
本技能提供一套完整的A股量化交易解决方案,基于v5.2评分体系优化而来,经过301天历史回测验证(2025-01-03~2026-04-03),在沪深300成分股中实现:
- 总收益: +26.7%(年化+21.2%)
- 夏普比率: 1.12
- 最大回撤: 15.2%
- 超额收益: +23.6%(跑赢大盘)
🎯 核心特性
1. 智能选股系统
- v5.2九维度综合评分(位置/量能/趋势/筹码/业绩/均线/换手率/情绪/超跌反弹)
- 量比>1.2硬过滤(确保资金活跃入场)
- 评分≥40分筛选
2. 严格风控体系
- 固定2%止损纪律
- 固定25%止盈纪律
- 最大3持仓,单只25%仓位
3. 尾盘交易策略
- 14:00扫描市场
- 14:30-15:00尾盘买入
- 避免盘中波动风险
📊 评分维度详解
| 维度 | 权重 | 评分规则 |
|---|---|---|
| 超跌反弹 | 20% | 近21日跌幅>30%→+20分, >25%→+15分 |
| 量能 | 15% | 量比>1.5→+15分, >1.2→+10分 |
| 位置 | 12% | 距60日均线\x3C20%→+20分, \x3C30%→+15分 |
| 业绩 | 12% | 净利润增长→加分 |
| 趋势 | 10% | MACD金叉+KDJ金叉→+15分 |
| 筹码 | 10% | 底部缩量+低位→+15分 |
| 均线 | 8% | MA5>MA20>MA60→+10分 |
| 换手率 | 8% | 4%~12%→+10分 |
| 情绪 | 5% | 涨跌幅2%~6%→+5分 |
🚀 使用方法
基础命令
# 扫描潜力股
python3 stock_analysis_v5.py
# 执行交易
python3 trading_workflow.py
# 查看持仓
cat positions.json
配置文件
所有策略参数在 trading_unified_config.json 中统一管理:
{
"version": "v6.0-g2-optimal",
"filter_criteria": {
"min_score": 40,
"vol_ratio_min": 1.2
},
"trading_rules": {
"stop_loss_pct": 2.0,
"take_profit_full_pct": 25.0
}
}
📁 文件结构
g2-trading-strategy/
├── SKILL.md # 技能定义文件
├── README.md # 详细文档
├── trading_unified_config.json # 统一配置文件
├── stock_analysis_v5.py # v5.2分析系统
├── trading_workflow.py # 交易工作流
├── positions.json # 持仓记录
├── scripts/
│ ├── stock_api_tencent.py # 腾讯API数据源
│ └── auto_backup.py # 自动备份
└── backtest_cache/ # 历史数据缓存
⚠️ 风险提示
- 本策略回测结果不代表未来收益
- A股市场波动大,请控制仓位
- 建议先用模拟盘验证
- 严格遵守止损纪律
📜 版本历史
- v6.0-g2-optimal (2026-04-05): 加入量比硬过滤,回测+26.7%
- v6.0-multi-agent (2026-04-03): 多代理系统
- v5.2 (2026-03-30): 九维度评分体系
💡 技术支持
如有问题,请提交Issue或联系技术支持。
本技能定价: ¥199/次下载
作者: 投资大师 (Investment Master)
安全使用建议
Do not run the 'execute trading' step or hand over credentials yet. Before using this skill: 1) Verify the missing files — request trading_workflow.py, positions.json, and scripts referenced in SKILL.md; do not run anything that isn't provided and inspected. 2) Inspect trading_workflow.py (if provided) to confirm whether it places real trades and which broker APIs it uses; require explicit documentation of required API keys. 3) Change the hardcoded DB_PATH to a safe local path inside a sandboxed directory (or run in an isolated VM/container) to avoid writing to /root/.openclaw. 4) If the multi‑agent/LLM features are desired, confirm where to supply API keys and only provide them in secure env vars after review. 5) Run initial scans and the stock_analysis script in simulation mode (no real order execution) and review network endpoints contacted (qt.gtimg.cn, ifzq.gtimg.cn, push2.eastmoney.com are expected data sources). 6) Because the source/homepage is unknown and the package advertises paid download, prefer running only in a sandbox with simulated funds and verifying code provenance before trusting with real money or credentials.
功能分析
Type: OpenClaw Skill
Name: g2-trading-strategy
Version: 1.0.0
The skill bundle implements a quantitative trading strategy for the A-share market. The core logic in `stock_analysis_v5.py` performs technical and fundamental analysis using standard financial data APIs from Tencent and EastMoney. No evidence of data exfiltration, unauthorized execution, or malicious prompt injection was found; the instructions and configurations are entirely focused on the stated trading strategy and risk management.
能力标签
能力评估
Purpose & Capability
The code and docs implement an A‑share selection/backtest system and call expected external data sources (Tencent/EastMoney). That fits the stated purpose. However SKILL.md and README reference many files (trading_workflow.py, positions.json, scripts/, backtest_cache/) that are not present in the provided file list; package.json also declares files that aren't included. This mismatch between claimed files and the provided bundle is an incoherence.
Instruction Scope
Runtime instructions tell the agent to run 'python3 stock_analysis_v5.py' and 'python3 trading_workflow.py' and to inspect positions.json. trading_workflow.py and positions.json are not present in the package, yet '执行交易' is explicitly suggested — that implies live trading capability. The SKILL.md and trading_unified_config.json also describe a multi‑agent LLM pipeline (openai/gpt‑4.5) and execution workflow but the skill declares no environment variables for LLM keys or broker credentials. The instructions are therefore incomplete and may hide steps that require sensitive credentials.
Install Mechanism
There is no install spec (instruction-only + supplied scripts). That is lower installation risk — nothing downloads arbitrary remote installers. Dependencies are typical Python libs (numpy, requests) and would be installed by the user environment, not the skill itself.
Credentials
The skill declares no required environment variables but the JSON config references an LLM provider ('openai', gpt-4.5) and a multi-agent framework which would normally require API keys. The main Python script hardcodes DB_PATH = '/root/.openclaw/workspace-financemaster/stock_data.db', writing to a root-scoped OpenClaw workspace path outside the skill directory. There is a mismatch: either required credentials/configs are omitted from metadata, or the skill expects to use existing agent/global state. Both are disproportionate and warrant caution.
Persistence & Privilege
always:false (good), but the script writes to an absolute DB path under /root/.openclaw and will create/modify an sqlite DB and tables. That gives the skill persistent local state outside its package directory. Combined with the documented but missing trading_workflow.py (which would likely perform execution), this raises risk if run on a machine with real accounts or sensitive agent workspaces.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install g2-trading-strategy - 安装完成后,直接呼叫该 Skill 的名称或使用
/g2-trading-strategy触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- 首发版本,基于21组策略回测,提供完整A股量化交易系统。
- 加入v5.2九维度评分体系与量比硬过滤,提升选股精准度。
- 严格风控规则:2%止损、25%止盈、最大3持仓。
- 支持尾盘交易策略,有效规避盘中波动。
- 统一参数配置,文件结构清晰,便于管理和扩展。
元数据
常见问题
G2量化交易策略 是什么?
基于21组策略回测,提供沪深300量化交易系统,年化收益21.2%,夏普率1.12,含智能选股和严格风控。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 77 次。
如何安装 G2量化交易策略?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install g2-trading-strategy」即可一键安装,无需额外配置。
G2量化交易策略 是免费的吗?
是的,G2量化交易策略 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
G2量化交易策略 支持哪些平台?
G2量化交易策略 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 G2量化交易策略?
由 Austin0208(@austin0208)开发并维护,当前版本 v1.0.0。
推荐 Skills