Install
$ agentstack add skill-atorber-qmt-trading-skill-qmt-bridge-daily-pnl ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
QMT Trading Skill · 当日盈亏
> 实现状态:✅ daily_pnl_snapshot.py 可用(见 [ROADMAP.md](../ROADMAP.md))
目标
快速回答「今天账户盈亏多少」:优先 QMT today_profit_loss;否则用持仓 + 当日成交 + 行情计算(非仅当前持仓量 × 涨跌幅)。
估算公式(单标的):
当日盈亏 = 现市值 − 昨收×昨仓 − 今日买入金额 + 今日卖出金额
拆解:昨仓浮动、今买浮动、今卖已实现;已清仓但当日有卖出的标的单独列出。
脚本
| 脚本 | 作用 | |------|------| | scripts/daily_pnl_snapshot.py | asset + positions + trades,汇总当日盈亏(含已清仓) |
python skills/qmt-bridge-daily-pnl/scripts/daily_pnl_snapshot.py --host 127.0.0.1 --port 8080 --api-key KEY
python skills/qmt-bridge-daily-pnl/scripts/daily_pnl_snapshot.py --json
主要 API
| 方法 | 路径 | 说明 | |------|------|------| | GET | /api/trading/positions | 持仓(含昨仓、QMT 当日盈亏等) | | GET | /api/trading/trades | 当日成交(买卖金额) | | GET | /api/trading/asset | 资产 | | GET | /api/market/full_tick | 现价/昨收 | | GET | /api/utility/batch_stock_name | 中文名称 |
操作规程
- 拉
positions、trades、asset - 按标的汇总当日买入/卖出量与金额;昨仓优先
yesterday_volume,否则现仓 − 今买 + 今卖 - 有 QMT
today_profit_loss则直接采用;否则用上述公式 +full_tick现价/昨收 - 输出持仓标的与当日已清仓标的;可选
--no-detail隐藏拆解 - 只读;与柜台可能有手续费/分红等细微差异
安全
- 只读;交易查询需
X-API-Key - 不提供投资建议式结论
参考
- [qmt-bridge-portfolio-risk](../qmt-bridge-portfolio-risk/SKILL.md) · [qmt-bridge-execution-review](../qmt-bridge-execution-review/SKILL.md)
docs/rest-api.md
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: atorber
- Source: atorber/qmt-trading-skill
- License: MIT
- Homepage: https://atorber.github.io/qmt-trading-skill/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.