Skip to content
Agentmart
Submit a tool

qmt-bridge-daily-pnl

通过 QMT Bridge 查看当日盈亏:结合当前持仓、昨仓与当日买卖成交计算,含已清仓标的。 在用户提到今日盈亏、当日收益、赚了多少、盘面盈亏时使用。只读。

Skill by atorber

IndexedMIT★ 25
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/atorber-qmt-bridge-daily-pnl

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

通过 QMT Bridge 查看当日盈亏:结合当前持仓、昨仓与当日买卖成交计算,含已清仓标的。 在用户提到今日盈亏、当日收益、赚了多少、盘面盈亏时使用。只读。

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/qmt-bridge-daily-pnl

What's inside

Skill name
qmt-bridge-daily-pnl
Description
通过 QMT Bridge 查看当日盈亏:结合当前持仓、昨仓与当日买卖成交计算,含已清仓标的。 在用户提到今日盈亏、当日收益、赚了多少、盘面盈亏时使用。只读。
License
MIT
Instructions
54 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (3)

  • SKILL.md
  • README.md · scripts/
  • daily_pnl_snapshot.py · scripts/

SKILL.md (first lines)

# QMT Trading Skill · 当日盈亏

> **实现状态**:✅ `daily_pnl_snapshot.py` 可用(见 [ROADMAP.md](../ROADMAP.md))

## 目标

快速回答「今天账户盈亏多少」:优先 QMT `today_profit_loss`;否则用**持仓 + 当日成交 + 行情**计算(非仅当前持仓量 × 涨跌幅)。

**估算公式**(单标的):

`当日盈亏 = 现市值 − 昨收×昨仓 − 今日买入金额 + 今日卖出金额`

拆解:昨仓浮动、今买浮动、今卖已实现;**已清仓**但当日有卖出的标的单独列出。

## 脚本

| 脚本 | 作用 |
|------|------|
| `scripts/daily_pnl_snapshot.py` | asset + positions + **trades**,汇总当日盈亏(含已清仓) |

```bash
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` | 中文名称 |

## 操作规程

1. 拉 `positions`、`trades`、`asset`
2. 按标的汇总当日买入/卖出量与金额;昨仓优先 `yesterday_volume`,否则 `现仓 − 今买 + 今卖`
3. 有 QMT `today_profit_loss` 则直接采用;否则用上述公式 + `full_tick` 现价/昨收
4. 输出持仓标的与**当日已清仓**标的;可选 `--no-detail` 隐藏拆解
5. **只读**;与柜台可能有手续费/分红等细微差异

## 安全

- 只读;交易查询需 `X-API-Key`
- 不提供投资建议式结论

## 参考

- [qmt-bridge-portfolio-risk](../qmt-bridge-portfolio-risk/SKILL.md) · [qmt-bridge-execution-review](../qmt-bridge-execution-review/SKILL.md)
- `[REST API](https://atorber.github.io/qmt-bridge/rest-api/)`

From atorber/qmt-trading-skill, MIT.

More from atorber/qmt-trading-skill

Signals

Stars
25
Forks
7
Open issues
0
Last commit (this folder)
Aug 14, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from atorber

Cite this page

qmt-bridge-daily-pnl skill. Agent Mart. https://agentmart.dev/skills/atorber-qmt-bridge-daily-pnl (last updated 2026-10-24)