trade-journal
它能做什么
这项技能读取你从券商导出的记录,并展示你实际的交易方式。适合希望客观审视自身交易习惯的个人投资者。
适用场景
- ✓当你上传券商对账单,并想了解你的胜率和收益概况的时候。
- ✓当你怀疑自己交易过于频繁,或者喜欢追逐价格变动的时候。
- ✓当你想看看自己是否倾向于过早卖出盈利股、过久持有亏损股的时候。
技能链接
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/trade-journal/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请分析我从 Futu 导出的交易记录,并告诉我是否存在不良的交易习惯。”
每周 5 个新技能,1 分钟读完。
工作原理
它会读取你的券商文件,识别格式,并生成一份包含胜率、持仓时间和回撤的概况。然后它会检查四种行为模式,并以数字为证据,按严重程度为每一种打分。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Trade Journal Analysis
Purpose
Users upload broker exports (交割单) and get an honest, data-grounded portrait of their own trading. Two layers are live:
- Profile — holding days, frequency, win rate, PnL ratio, cumulative PnL, max drawdown, top symbols, market/hourly distribution.
- Behavior diagnostics — 4 biases, each with severity (low/medium/high) and numeric evidence: disposition effect, overtrading, chasing momentum, anchoring.
Strategy extraction → backtest bridge lands in Phase 4c.
Supported formats (auto-detected):
- 同花顺 (Tonghuashun) — A-share CSV, typically GBK-encoded
- 东方财富 (Eastmoney) — A-share CSV, typically GBK-encoded
- 富途 (Futu) — HK/US CSV, UTF-8
- Generic — any CSV with columns like
datetime/symbol/side/qty/price
Usage
Call the analyze_trade_journal tool directly. Never run Python from bash.
analyze_trade_journal(file_path="uploads/xxx.csv")
analyze_trade_journal(file_path="uploads/xxx.csv", analysis_type="profile")
analyze_trade_journal(file_path="uploads/xxx.csv", filter_expr="2026-01 to 2026-03")
analyze_trade_journal(file_path="uploads/xxx.csv", filter_expr="symbol=600519.SH")
analyze_trade_journal(file_path="uploads/xxx.csv", filter_expr="market=china_a")
analysis_type:
full(default) — profile + behavior (strategy still placeholder)profile— profile metrics only (fastest)behavior— 4 behavior diagnostics onlystrategy— Phase 4c placeholder
filter_expr (optional):
- Date range:
"YYYY-MM to YYYY-MM"or"YYYY-MM-DD to YYYY-MM-DD" - Symbol:
"symbol=600519.SH"(exact match on qualified symbol) - Market:
"market=china_a|us|hk|crypto"
Return shape (profile subset)
{
"status": "ok",
"file": "xxx.csv",
"format_detected": "tonghuashun",
"total_records": 326,
"date_range": "2026-01-06 ~ 2026-03-28",
"symbols_count": 42,
"market": "china_a",
"profile": {
"total_trades": 326,
"total_roundtrips": 118,
"avg_holding_days": 3.2,
"trade_frequency_per_week": 4.1,
"win_rate": 0.48,
"profit_loss_ratio": 1.35,
"total_pnl": 18240.55,
"max_drawdown": -9820.10,
"top_symbols": [{"symbol": "600519.SH", "trades": 14, "total_amount": 1.02e6}, ...],
"market_distribution": {"china_a": 326},
"hourly_distribution": {9: 52, 10: 84, ...},
"roundtrips_sample": [{"symbol": "600519.SH", "buy_dt": "...", "sell_dt": "...", "pnl": 3400.1, "pnl_pct": 0.021, "hold_days": 2.5}, ...]
}
}
Note: PnL uses FIFO lot matching; unmatched open positions are excluded from win rate / PnL ratio (only closed round-trips count). Drawdown starts from zero realized PnL, so the first losing close counts.
For mixed-currency journals, total_pnl, total_dividends, max_drawdown
and profit_loss_ratio are currency-keyed objects. Present each currency
separately; never add their values or average their ratios. Dividend-only
journals follow the same rule. overtrading.by_currency contains each
currency’s activity diagnosis; mixed journals rank top_symbols by trade
count and label amounts with their currency. No FX conversion is implied.
Presenting results to the user
Produce a single markdown report in the user's language. Lead with the top-line numbers, then section-by-section. Keep it dense — this is retail readers skimming on a phone.
Report template
## 你的交易画像 — {date_range}
**总体**
- 交易笔数:{total_trades}(完整来回 {total_roundtrips} 次)
- 平均持仓:{avg_holding_days} 天
- 交易频率:{trade_frequency_per_week} 次/周
- 胜率:{win_rate:.0%}
- 盈亏比:{profit_loss_ratio}
- 累计盈亏:{total_pnl}
- 最大回撤:{max_drawdown}
**最常交易的标的**(前 5 名)
| 标的 | 笔数 | 成交额 |
|------|------|--------|
| ... | ... | ... |
**市场分布**
{market_distribution}
**交易时段**
{hourly_distribution — highlight peak hours}
**一句话观察**
(根据数据写 1-2 句:过度交易?只做窄范围标的?集中在某时段?)
Guidance:
- If
win_rate < 0.4ANDprofit_loss_ratio < 1.0→ explicit warning: losing on both win rate and payoff. Ask whether they want behavior diagnostics (Phase 4b) or a cooling-off reality check. - If
avg_holding_days < 1ANDtrade_frequency_per_week > 15→ flag intraday-heavy pattern, note that minute-level backtest would be better. - If
symbols_count <= 3→ concentration risk; ask if they want a sector- diversification check.
Follow-up dialogue
After the initial report, users typically ask:
- Time-slice: "3 月份表现怎么样" → re-call with
filter_expr="2026-03-01 to 2026-03-31". - Symbol deep-dive: "茅台这只赚了多少" → `filter_expr="symbol
常见问题
支持哪些券商格式?
它可以读取同花顺、Eastmoney 和 Futu 的导出文件,以及带有标准列的通用 CSV 文件。
它检查哪些偏差?
它检查处置效应、过度交易、追涨和锚定效应。
我可以按日期或股票进行筛选吗?
可以。你可以按日期范围、代码或市场来筛选分析内容。
详情
作者的原始描述
Analyze a user's trade journal (CSV/Excel broker export). Parses 同花顺/东方财富/富途/generic formats, produces a trading profile and 4 behavior diagnostics (disposition effect, overtrading, chasing, anchoring). Use the `analyze_trade_journal` tool.
repo: HKUDS/Vibe-Trading
热度
- GitHub 星标
- 37k
- 排名
- #7562
- 许可证
- MIT
- 更新时间
- 2026/11/1
评论
- …