← Back to Skills Marketplace
tangsuann

ETF模拟交易回测系统

by TangSuann · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
314
Downloads
1
Stars
4
Active Installs
1
Versions
Install in OpenClaw
/install etf-trading-backtest
Description
ETF模拟交易回测系统。支持A股ETF日内交易策略的模拟交易与回测分析,包括BOLL、MACD、KDJ等技术指标组合判断,自动计算手续费、止损止盈、风险指标(最大回撤、夏普比率等)。适用于船舶ETF(560710)等标的的量化交易回测。当用户提及:ETF模拟交易、股票回测、量化交易策略回测、技术指标交易、回测分析...
README (SKILL.md)

ETF模拟交易回测系统

简介

本Skill提供ETF/股票模拟交易和回测分析功能,基于技术指标(BOLL、MACD、KDJ)判断买卖信号,支持自动计算手续费、止损止盈、风险指标统计。

核心功能

  1. 实时模拟交易 - 根据技术指标信号执行模拟买入/卖出
  2. 回测分析 - 基于历史数据回测策略表现
  3. 风险指标计算 - 最大回撤、夏普比率、卡玛比率等
  4. 报告生成 - 自动生成交易报告和复盘分析

交易标的

默认标的:560710 富国中证智选船舶产业ETF

可扩展到其他ETF/股票。

交易规则

规则 说明
交易时间 工作日9:30-15:00
交易频率 每天最多1次操作
T+1规则 当日买入,次日才能卖出
手续费 买入0.025% + 卖出0.025% + 印花税0.1%
初始资金 100万(模拟)
止损线 -5%
止盈线 +8%

买卖信号

买入信号

信号类型 条件 优先级
BOLL下轨+KDJ超卖 价格触及BOLL下轨 + KDJ的J\x3C20
突破中轨+放量 价格突破BOLL中轨 + 成交量放大>1.5倍
MACD底背离 价格创新低,MACD未创新低

卖出信号

信号类型 条件 优先级
BOLL上轨+KDJ超买 价格触及BOLL上轨 + KDJ的J>80
死叉 MACD死叉 + KDJ死叉
止损 亏损达到-5% 强制
止盈 盈利达到+8% 可选

风险指标

指标 说明 理想值
总收益率 最终收益/初始资金 越高越好
年化收益率 年化后的收益率 >15%
胜率 盈利交易占比 >50%
盈亏比 平均盈利/平均亏损 >1.5
最大回撤 从最高点到最低点的跌幅 \x3C15%
夏普比率 风险调整后收益 >1.0
卡玛比率 收益/最大回撤 >1.5

使用方式

1. 触发方式

当用户提及以下关键词时自动触发:

  • "ETF模拟交易"
  • "股票回测"
  • "量化交易策略回测"
  • "技术指标交易"
  • "回测分析"
  • "560710交易"
  • "船舶ETF"

2. 执行流程

1. 获取实时/历史行情数据
2. 计算BOLL、MACD、KDJ指标
3. 判断买卖信号
4. 执行模拟交易(如触发信号)
5. 记录交易日志
6. 计算风险指标
7. 生成报告

3. 定时任务(可选)

可通过Cron设置每日定时执行:

  • 9:30 开盘分析
  • 14:50 尾盘确认
  • 15:00 收盘复盘

脚本说明

scripts/trade.py

主交易脚本,包含:

  • get_realtime_data() - 获取实时行情
  • calculate_indicators() - 计算技术指标
  • generate_signals() - 生成买卖信号
  • execute_trade() - 执行模拟交易
  • calculate_metrics() - 计算风险指标

references/rules.md

详细交易规则和参数配置。

输出格式

交易报告

## 📊 日内交易报告

### 交易概要
- **日期**:2026-03-17
- **操作**:买入
- **信号强度**:⭐⭐

### 盈亏情况
- **当前持仓**:10000份
- **持仓盈亏**:+500元 (+0.5%)

回测报告

## 📈 回测报告

### 基础统计
- 总收益率:+15.84%
- 年化收益率:+42.35%
- 胜率:64.29%

### 风险指标
- 最大回撤:-8.42%
- 夏普比率:1.56
- 卡玛比率:5.02

注意事项

  1. 模拟交易仅供学习参考,不构成投资建议
  2. 技术指标可能失效,需结合市场环境判断
  3. 严格执行止损纪律
  4. 建议先在模拟环境测试

扩展定制

如需修改默认参数,可编辑:

  • 交易标的代码
  • 初始资金
  • 手续费率
  • 止损止盈线
  • 技术指标参数

版本: 1.0.0 创建日期: 2026-03-17

Usage Guidance
This skill appears to do what it says: fetch market data and run local simulations. Before installing: (1) be prepared to run the Python script (ensure Python and the 'requests' package are available), (2) note the script uses eastmoney HTTP endpoints (data is fetched over plain http in the shipped code — consider changing to https if you want encrypted transport), (3) run it in a sandbox or test environment and inspect/trust the external data source (eastmoney) before relying on results, and (4) remember simulation outputs are not investment advice.
Capability Analysis
Type: OpenClaw Skill Name: etf-trading-backtest Version: 1.0.0 The skill bundle provides a legitimate ETF trading backtest and simulation system. The Python script (scripts/trade.py) implements standard technical indicators and fetches market data from public EastMoney API endpoints (eastmoney.com) without any signs of data exfiltration, unauthorized execution, or malicious intent.
Capability Assessment
Purpose & Capability
Name/description (ETF backtest) align with included files: SKILL.md, config, rules, and a Python trade script that fetches market data and performs indicator calculations and simulated trades. The external HTTP endpoints (eastmoney) are consistent with getting market data.
Instruction Scope
SKILL.md instructions and the script stick to fetching market data, computing indicators, generating signals, simulating trades, and producing reports. They do not request unrelated files, system credentials, or arbitrary data. Note: the skill will make network requests to eastmoney endpoints when triggered.
Install Mechanism
No install spec (instruction-only + included Python script). This is low-risk, but the script depends on the Python 'requests' library (not declared). There is no packaged install and no arbitrary download from unknown URLs.
Credentials
The skill declares no required environment variables, credentials, or config paths. The requested resource access (HTTP GET to market-data endpoints) is proportional to its stated function.
Persistence & Privilege
always is false and the skill does not request elevated platform privileges or modify other skills. It can be invoked autonomously per platform defaults, which is expected for user-invocable skills.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install etf-trading-backtest
  3. After installation, invoke the skill by name or use /etf-trading-backtest
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
支持A股ETF日内交易策略的模拟交易与回测分析
Metadata
Slug etf-trading-backtest
Version 1.0.0
License MIT-0
All-time Installs 4
Active Installs 4
Total Versions 1
Frequently Asked Questions

What is ETF模拟交易回测系统?

ETF模拟交易回测系统。支持A股ETF日内交易策略的模拟交易与回测分析,包括BOLL、MACD、KDJ等技术指标组合判断,自动计算手续费、止损止盈、风险指标(最大回撤、夏普比率等)。适用于船舶ETF(560710)等标的的量化交易回测。当用户提及:ETF模拟交易、股票回测、量化交易策略回测、技术指标交易、回测分析... It is an AI Agent Skill for Claude Code / OpenClaw, with 314 downloads so far.

How do I install ETF模拟交易回测系统?

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

Is ETF模拟交易回测系统 free?

Yes, ETF模拟交易回测系统 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does ETF模拟交易回测系统 support?

ETF模拟交易回测系统 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created ETF模拟交易回测系统?

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

💬 Comments