← Back to Skills Marketplace
austin0208

G2量化交易策略

by Austin0208 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
77
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install g2-trading-strategy
Description
基于21组策略回测,提供沪深300量化交易系统,年化收益21.2%,夏普率1.12,含智能选股和严格风控。
README (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/          # 历史数据缓存

⚠️ 风险提示

  1. 本策略回测结果不代表未来收益
  2. A股市场波动大,请控制仓位
  3. 建议先用模拟盘验证
  4. 严格遵守止损纪律

📜 版本历史

  • 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)

Usage Guidance
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.
Capability Analysis
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.
Capability Tags
cryptorequires-walletcan-sign-transactions
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install g2-trading-strategy
  3. After installation, invoke the skill by name or use /g2-trading-strategy
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- 首发版本,基于21组策略回测,提供完整A股量化交易系统。 - 加入v5.2九维度评分体系与量比硬过滤,提升选股精准度。 - 严格风控规则:2%止损、25%止盈、最大3持仓。 - 支持尾盘交易策略,有效规避盘中波动。 - 统一参数配置,文件结构清晰,便于管理和扩展。
Metadata
Slug g2-trading-strategy
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is G2量化交易策略?

基于21组策略回测,提供沪深300量化交易系统,年化收益21.2%,夏普率1.12,含智能选股和严格风控。 It is an AI Agent Skill for Claude Code / OpenClaw, with 77 downloads so far.

How do I install G2量化交易策略?

Run "/install g2-trading-strategy" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is G2量化交易策略 free?

Yes, G2量化交易策略 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does G2量化交易策略 support?

G2量化交易策略 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created G2量化交易策略?

It is built and maintained by Austin0208 (@austin0208); the current version is v1.0.0.

💬 Comments