← 返回 Skills 市场
403
总下载
2
收藏
2
当前安装
2
版本数
在 OpenClaw 中安装
/install a-stock-trader
功能描述
A股模拟交易系统 - 数据爬取、存储、策略回测、模拟交易 / A-Share Paper Trading System - Data Fetch, Storage, Backtest, Simulation
使用说明 (SKILL.md)
A股模拟交易系统 / A-Share Paper Trading System
这是一个完整的A股模拟交易系统,包含数据获取、存储、策略回测和模拟交易功能。
This is a complete A-share paper trading system with data fetching, storage, strategy backtest and simulation.
功能模块 / Function Modules
1. 数据爬取 / Data Fetching
- 实时行情数据(10分钟级别)/ Real-time data (10-min level)
- 历史K线数据(日/周/月)/ Historical K-line (daily/weekly/monthly)
- 个股基本面数据 / Stock fundamentals
- 大盘指数数据 / Market index data
- 数据源:东方财富网、新浪财经 / Data source: East Money, Sina Finance
2. 数据存储 / Data Storage
- SQLite 数据库 / SQLite database
- 表结构:日线数据、财务数据、持仓记录、交易记录 / Tables: daily_data, financials, positions, trades
- 数据路径:
~/.openclaw/workspace/a-stock// Data path
3. 模拟交易 / Paper Trading
- 纸上交易(不真实下单)/ Paper trading (no real orders)
- 持仓管理 / Position management
- 资金管理(初始100万)/ Capital management (initial 1M)
- 收益计算 / PnL calculation
4. 策略模板 / Strategy Templates
4.1 均线策略 (MA) / Moving Average Strategy
- 金叉买入,死叉卖出 / Buy on golden cross, sell on death cross
- 参数:MA5, MA10, MA20 / Parameters
4.2 动量策略 (Momentum) / Momentum Strategy
- 追涨杀跌 / Trend following
- 涨幅>5%买入,回撤>3%卖出 / Buy when +5%, sell when -3%
4.3 突破策略 (Breakout) / Breakout Strategy
- 20日高点突破买入 / Buy on 20-day high breakout
- 跌破5日低点卖出 / Sell on 5-day low break
4.4 网格策略 (Grid) / Grid Strategy
- 震荡行情网格交易 / Grid trading in ranging market
- 设定价格区间和网格数量 / Set price range and grid count
使用示例 / Usage Examples
获取数据 / Fetch Data
python scripts/fetch_daily.py --stock 600519 --days 250
运行回测 / Run Backtest
python scripts/backtest.py --strategy ma --stock 600519
模拟交易 / Paper Trade
python scripts/simulate.py --strategy momentum --stock 600519
查看持仓 / Show Portfolio
python scripts/simulate.py --show
数据结构 / Data Schema
daily_data (日线数据 / Daily Data)
| 字段/Field | 类型/Type | 说明/Description |
|---|---|---|
| date | TEXT | 日期 / Date |
| code | TEXT | 股票代码 / Stock code |
| open | REAL | 开盘价 / Open |
| high | REAL | 最高价 / High |
| low | REAL | 最低价 / Low |
| close | REAL | 收盘价 / Close |
| volume | REAL | 成交量 / Volume |
| amount | REAL | 成交额 / Amount |
positions (持仓 / Positions)
| 字段/Field | 类型/Type | 说明/Description |
|---|---|---|
| code | TEXT | 股票代码 / Stock code |
| name | TEXT | 股票名称 / Stock name |
| shares | INTEGER | 股数 / Shares |
| cost | REAL | 成本价 / Cost |
| buy_date | TEXT | 买入日期 / Buy date |
trades (交易记录 / Trade Records)
| 字段/Field | 类型/Type | 说明/Description |
|---|---|---|
| date | TEXT | 交易日期 / Date |
| code | TEXT | 股票代码 / Stock code |
| type | TEXT | buy/sell |
| price | REAL | 价格 / Price |
| shares | INTEGER | 股数 / Shares |
| pnl | REAL | 盈亏 / PnL |
定时任务 / Scheduled Tasks
系统会自动:/ System will automatically:
- 每天收盘后获取当日数据 / Fetch daily data after market close
- 每周运行策略回测 / Run weekly backtest
- 每月生成交易报告 / Generate monthly report
注意事项 / Notes
- 本系统仅供学习研究,不构成投资建议 / For learning only, not investment advice
- 模拟交易不涉及真实资金 / No real money involved
- 历史业绩不代表未来表现 / Past performance doesn't guarantee future results
安全使用建议
This skill appears internally consistent for a local paper‑trading tool. Before running: (1) review the scripts yourself and run them in an isolated environment (VM/container) since they perform network requests and write to ~/.openclaw/workspace/a-stock/; (2) be aware data is fetched from East Money (push2his.eastmoney.com) — if you need privacy or different data sources, modify fetch_daily.py; (3) note the docs mention scheduled tasks but no scheduler is installed automatically — you must set up cron/systemd timers yourself if desired; (4) consider the small coding issues (unparameterized SQL in backtest.py) and avoid feeding untrusted inputs to the CLI; (5) no credentials are requested, but monitor outbound network activity if that concerns you.
功能分析
Type: OpenClaw Skill
Name: a-stock-trader
Version: 1.0.1
The skill bundle implements a functional A-share paper trading system, but it contains a SQL injection vulnerability in `scripts/backtest.py` where the `code` parameter is directly interpolated into a SQL query string. While the overall behavior aligns with the stated purpose and no evidence of intentional malice (such as data exfiltration or backdoors) was detected, the lack of input sanitization in database operations is a high-risk flaw.
能力评估
Purpose & Capability
Name/description describe data fetch, storage, backtest and simulation; included scripts (fetch_daily.py, backtest.py, simulate.py) implement those features. Required env vars/binaries/config paths are none and align with a local simulation tool.
Instruction Scope
SKILL.md and examples limit actions to running the bundled scripts and write data under ~/.openclaw/workspace/a-stock/. The docs claim scheduled automatic tasks (daily/weekly/monthly), but no installer or scheduler is provided — automatic scheduling appears to be a documentation statement rather than implemented behavior. Code performs network fetching (requests to East Money API) and local DB reads/writes as expected. Also note minor coding concerns: backtest.py builds an SQL query via f-string (pandas.read_sql) which could allow injection if untrusted input is fed into the script; fetch/backtest/simulate expect CLI args and local DB, so risk is limited to local execution context.
Install Mechanism
No install spec; this is instruction + bundled scripts only. Nothing is downloaded or extracted during install, which minimizes persistence/supply-chain risk.
Credentials
No environment variables, credentials, or config paths are requested. The code makes outbound HTTP requests to East Money (push2his.eastmoney.com) which is consistent with the stated data source and does not require credentials.
Persistence & Privilege
Skill is not always-enabled and does not request elevated privileges or modify other skills. It writes data only under the user home workspace path (~/.openclaw/workspace/a-stock/).
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install a-stock-trader - 安装完成后,直接呼叫该 Skill 的名称或使用
/a-stock-trader触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Added full bilingual (Chinese/English) documentation and descriptions in SKILL.md for broader accessibility.
- Minor clarifications and improved instructions in usage examples and table annotations.
- No changes to core functionality; updates focus on documentation and presentation.
v1.0.0
- Initial release of the A股模拟交易系统 (A-Stock Trader).
- Features real-time and historical data crawling (东方财富网, 新浪财经).
- Stores data in SQLite; supports tables for daily data, financials, positions, and trades.
- Includes four built-in strategy templates: MA crossover, momentum, breakout, and grid trading.
- Provides backtesting and paper trading modules with capital and position management.
- Automated daily data updates, weekly backtests, and monthly trade reporting.
元数据
常见问题
A Stock Trader 是什么?
A股模拟交易系统 - 数据爬取、存储、策略回测、模拟交易 / A-Share Paper Trading System - Data Fetch, Storage, Backtest, Simulation. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 403 次。
如何安装 A Stock Trader?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install a-stock-trader」即可一键安装,无需额外配置。
A Stock Trader 是免费的吗?
是的,A Stock Trader 完全免费(开源免费),可自由下载、安装和使用。
A Stock Trader 支持哪些平台?
A Stock Trader 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 A Stock Trader?
由 BOMBFUOCK(@bombfuock)开发并维护,当前版本 v1.0.1。
推荐 Skills