Sim Trade
v1.1.0A 股模拟交易盘 - 支持真实行情、多平台模拟盘连接、持仓管理、盈亏计算
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name/description (模拟交易盘) align with the included scripts: account, positions, trade, quote, sync, etc. Required resources (none declared) and the code's dependencies (requests) are appropriate for fetching quotes and running a local simulator.
Instruction Scope
SKILL.md and scripts operate on local files under ~/.openclaw/sim_trade and call public quote APIs (qt.gtimg.cn). The README instructs users how to copy browser Cookies for connecting to third‑party simulated platforms; that legitimately requires adding session cookies or broker tokens to config.json, but storing such secrets in plaintext is a risk the user must accept. Minor usability issue: example python -c commands in SKILL.md use a literal '~' inside a Python string which will not expand to the home directory, possibly writing to a filename that literally starts with '~/'.
Install Mechanism
No install spec; this is instruction + code that runs with the system Python and the requests package (declared in skill.json). No downloads or third‑party install URLs are used by the skill itself.
Credentials
The skill requests no environment variables or external credentials at install time. It does provide a config.json where users may place cookies or broker tokens if they choose to connect to real simulated accounts — that is proportionate to the claimed capability but does mean secrets will be stored locally in cleartext unless the user protects the file.
Persistence & Privilege
always:false and no code modifies other skills or global agent settings. The skill creates/reads files only under ~/.openclaw/sim_trade, which is appropriate for its function.
Assessment
This skill appears to do exactly what it says: a local simulated A‑share trading tool that can optionally connect to third‑party simulated accounts if you paste session cookies or broker tokens into ~/.openclaw/sim_trade/config.json. Before installing: (1) Understand that adding browser Cookies or broker tokens grants the skill access to that account data — store them only if you trust the environment and delete them when not needed. (2) Protect the config directory (file permissions) because credentials are stored in plaintext. (3) If you don't need real platform syncing, use the default 'local' mode to avoid exposing credentials. (4) The SKILL.md examples that use ~ inside Python string literals may not expand to your home directory; double-check paths when running the provided commands. (5) The skill depends on the requests package — ensure your environment provides it. Overall the package is coherent and not suspicious, but treat any pasted cookies or API tokens as sensitive secrets.Like a lobster shell, security has layers — review code before you run it.
latest
Sim Trade - 模拟股票交易盘 🎮📈
🎯 核心功能
| 功能 | 说明 |
|---|---|
| ✅ 真实行情 | 东方财富实时行情 API |
| ✅ 多平台模拟盘 | 同花顺/东方财富/蚂蚁财富(需登录) |
| ✅ 本地模拟 | 虚拟资金练习(无需外部账户) |
| ✅ 持仓管理 | 成本、数量、浮动盈亏 |
| ✅ 交易记录 | 完整成交日志 |
🚀 快速开始
1️⃣ 初始化(本地模拟模式)
cd ~/.openclaw/workspace/skills/sim-trade/scripts
python3 init_account.py
2️⃣ 行情查询
# 查询单只股票
python3 quote.py 600900
# 批量查询持仓股票行情
python3 quote.py
🌐 连接真实模拟盘
方式一:东方财富模拟盘(需要 Cookie)
- 在浏览器登录东方财富模拟交易
- 获取 Cookie(开发者工具 → Network → 复制请求头中的 Cookie)
- 配置文件:
~/.openclaw/sim_trade/config.json
{
"mode": "eastmoney",
"cookie": "your_cookie_here"
}
方式二:同花顺模拟盘(需要 Cookie)
同上,获取同花顺账号的 Cookie
方式三:券商 API(如华泰、银河)
{
"mode": "broker",
"broker": "htf",
"token": "your_api_token"
}
📁 文件结构
sim-trade/
├── SKILL.md
├── README.md
└── scripts/
├── config.py
├── account.py
├── positions.py
├── quote.py # 行情查询
├── trade.py # 交易执行
├── sync.py # 同步真实账户
├── show_account.py
├── show_positions.py
├── list_trades.py
└── init_account.py
⚙️ 配置说明
config.py
# 交易模式
# - "local": 本地模拟(默认)
# - "eastmoney": 东方财富模拟盘
# - "tonghuashun": 同花顺模拟盘
# - "broker": 券商 API
TRADE_MODE = "local"
# 东方财富 Cookie(获取模拟盘数据用)
EASTMONEY_COOKIE = ""
# 券商配置
BROKER = "htf" # 华泰
BROKER_TOKEN = ""
💡 使用示例
本地模拟交易
# 初始化
python3 init_account.py
# 买入(市价)
python3 trade.py buy 600900 100
# 买入(限价)
python3 trade.py buy 600900 100 --price 27.00
# 卖出
python3 trade.py sell 600900 50
# 查看账户
python3 show_account.py
查询实时行情
python3 quote.py 600900
python3 quote.py 600900 600025 600919
⚠️ 风险提示
- 本系统仅供学习参考,不构成投资建议
- 模拟盘交易不代表真实交易结果
- 真实账户连接需要妥善保管账号信息
<div align="center"> <strong>Sim Trade ✨</strong><br> 连接真实行情,练习实盘操作 📈🎮 </div>
Comments
Loading comments...
