Agent skill

Trade Journal Analysis

by HKUDS in HKUDS/Vibe-Trading

Reads a broker export of your trades (CSV or Excel), builds a trading profile and runs four behavior checks: disposition effect, overtrading, chasing and anchoring.

MITAuto-check passedBusiness, Finance & HR

Install Trade Journal Analysis

skills CLI
$ npx skills add HKUDS/Vibe-Trading --skill trade-journal -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/Vibe-Trading trade-journal --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agent/src/skills/trade-journal .claude/skills/trade-journal && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
trade-journal
GitHub stars
35k
Token cost
~1.8k tokens
SKILL.md length
466 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Reads a broker export of your trades (CSV or Excel), builds a trading profile and runs four behavior checks: disposition effect, overtrading, chasing and anchoring.

  • Reviewing your own trading history exported from a broker
  • SKILL.md covers Purpose, Usage, Return shape (profile subset) and Presenting results to the user, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Checking a trade history for the disposition effect, overtrading, chasing or anchoring

What it does

You hand the agent a broker export and it calls the `analyze_trade_journal` tool, which detects the format on its own: Tonghuashun and Eastmoney A-share CSVs, Futu Hong Kong and US CSVs, or any generic CSV with datetime, symbol, side, quantity and price columns. The profile covers holding days, trade frequency, win rate, profit-and-loss ratio, cumulative profit, maximum drawdown, top symbols and the spread across markets and hours of the day.

Four behavior diagnostics each come with a low, medium or high severity and numeric evidence: disposition effect, overtrading, chasing momentum and anchoring. The tool runs in full, profile-only or behavior-only mode and can filter by date range, symbol or market. Profit and loss uses FIFO lot matching, and open positions are left out of the win-rate figures. The agent then writes one dense Markdown report in your language. The strategy extraction layer is still a placeholder.

When your agent uses it

  • Reviewing your own trading history exported from a broker
  • Checking a trade history for the disposition effect, overtrading, chasing or anchoring
  • Calculating win rate, profit-loss ratio and drawdown from a trade export
  • Narrowing an analysis to a single month, symbol or market

Example prompts

  • “Analyze my broker export at uploads/futu_trades.csv and give me a full profile.”
  • “Run only the behavior diagnostics on my trades and tell me how severe the overtrading is.”
  • “Look at my Eastmoney export for 2026-01 to 2026-03 and summarize win rate and drawdown.”

Requirements

  • A broker trade export in CSV or Excel format
  • The `analyze_trade_journal` tool

What it can do on your machine

Read from SKILL.md and the folder at commit b1f6ce7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Trade Journal Analysis loads about 1.8k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 466 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/Vibe-Trading at commit b1f6ce7, republished under its MIT licence (© HKUDS). 466 words, ~1,768 tokens.

Download SKILL.mdSave it as .claude/skills/trade-journal/SKILL.md (or your agent's skills folder).
name
trade-journal
description
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.
category
tool

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 only
  • strategy — 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)

json
{
  "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).

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.4 AND profit_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 < 1 AND trade_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.
Show full SKILL.md (206 more words)Show less

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=600519.SH".
  • Market split: "港股和美股分开看" → two calls, market=hk and market=us.
  • Hypothetical ("如果我严格止损 -5%") → Phase 4b feature; for now tell the user this is on the roadmap.

Do NOT re-upload — the file path is still valid for subsequent tool calls in the same session.

Error handling

  • File not found / Unsupported extension — ask user to re-upload.
  • Unrecognized trade journal format — share the detected columns back to the user and ask them to rename the key columns to: datetime, symbol, side, quantity, price, amount, fee (generic fallback).
  • No trade records parsed — likely empty file or header-only; ask user to confirm the export contains actual fills.

Behavior diagnostics (shape)

Under result["behavior"]:

json
{
  "disposition_effect": {
    "severity": "high",
    "ratio_loss_to_win_hold": 1.69,
    "avg_winner_hold_days": 7.4,
    "avg_loser_hold_days": 12.5,
    "evidence": "Losing roundtrips held 12.5d vs winning 7.4d (ratio 1.69). Classic disposition pattern."
  },
  "overtrading": {
    "severity": "high",
    "busy_day_avg_pnl": -2632,
    "quiet_day_avg_pnl": 759,
    "evidence": "On busy days (≥3 trades) avg PnL -2632; on quiet days (≤1) avg PnL +759. High activity hurts returns."
  },
  "chasing_momentum": {
    "severity": "medium",
    "chase_ratio": 0.5,
    "buys_evaluated": 4,
    "evidence": "2/4 buys (50%) came after a >3% price run-up in the same symbol. Some chasing tendency."
  },
  "anchoring": {
    "severity": "high",
    "anchored_symbol_ratio": 0.83,
    "symbols_evaluated": 6,
    "anchored_symbols": [...],
    "evidence": "5/6 frequently-traded symbols stayed in a narrow price band (CV<5%). Strong anchoring."
  }
}
Detection logic (for user-facing explanation)
BiasMetricMediumHigh
Disposition effectavg_loser_hold / avg_winner_hold≥ 1.2≥ 1.5
Overtrading(quiet − busy) / |quiet| day-PnL gap≥ 0.3≥ 1.0
Chasingfraction of buys after 3-trade rolling +3% move≥ 40%≥ 60%
Anchoringfraction of ≥5-trade symbols with price CV < 5%≥ 33%≥ 66%
Report section (Chinese)
## 行为偏差诊断

| 偏差 | 严重程度 | 核心证据 |
|------|----------|----------|
| 处置效应 | {high/medium/low} | {evidence} |
| 过度交易 | {...} | {...} |
| 追涨杀跌 | {...} | {...} |
| 锚定效应 | {...} | {...} |

**改进建议**(根据检测到的 high/medium 项生成):
- 处置效应 high → 写死止损(例如 -8%),盈利持仓不要过早兑现
- 过度交易 high → 每日交易次数 <= N 的硬约束
- 追涨杀跌 high → 改买回调而不是新高,设置"涨幅 X% 以上当日不追"规则
- 锚定效应 high → 扩宽价格带,不要死守某个"心理价"

Phase 4c preview (not yet implemented)

Strategy extraction → SignalEngine code gen → auto-backtest lands in Phase 4c. When the user asks for it, respond honestly and offer the behavior diagnostics instead (they're live).

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in agent/src/skills/trade-journal of HKUDS/Vibe-Trading.

Open the folder on GitHubat commit b1f6ce7

Compare with similar skills

Trade Journal Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Trade Journal Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Trade Journal Analysis this skillHKUDS/Vibe-Trading35k—~1.8kAutomated safety check: PassMIT
Anti Gambling Tradermars-tw/anti-gambling-trader-tw907—~1.9kAutomated safety check: PassMIT
Data UpdateSixian-Li/plain-backtest204—~1.6kAutomated safety check: PassMIT
Regimejackson-video-resources/markov-hedge-fund-method484—~1.6kAutomated safety check: PassCustom licence
Trading212 APItrading212-labs/agent-skills129—~11kAutomated safety check: PassMIT
Mx Finance Datahiboys/ExploreFinance365—~518Automated safety check: PassNone

Similar skills

  • Anti Gambling Trader

    mars-tw/anti-gambling-trader-tw

    分析台股 / 台股ETF / 台指期選擇權 / 美股 / 加密貨幣 / 外匯的交易紀錄 (CSV / JSON / Excel),用統計學判斷使用者的獲利是「可重複的優勢」還是 「運氣 + 倖存者偏差(賭博)」,不適合長期投資會明確勸退。內建反詐工具: 掃描群組對話的詐騙話術(scan-text)、檢驗老師宣稱的績效(guru-check)、…

    907 GitHub stars~1.9k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Data Update

    Sixian-Li/plain-backtest

    Operate and assess the Quant workspace market-data layer through the tested data-update CLI.

    204 GitHub stars~1.6k tokensUpdated 13 days ago
    Documents & OfficeAuto-check passed
  • Regime

    jackson-video-resources/markov-hedge-fund-method

    Detect the market regime (Bull / Bear / Sideways) for ANY asset and turn it into a tradeable signal or a risk filter.

    484 GitHub stars~1.6k tokensUpdated 4 mo ago
    Business, Finance & HRAuto-check passed
  • Trading212 API

    trading212-labs/agent-skills

    This skill should be used when the user asks to "connect to Trading 212", "authenticate Trading 212 API", "place a trade", "buy stock", "sell shares", "place market order",, "place pending order"…

    129 GitHub stars~11k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed
  • Mx Finance Data

    hiboys/ExploreFinance

    基于东方财富数据库,支持自然语言查询金融数据,覆盖A港美、基金、债券等多种资产,含实时行情、公司信息、估值、财务报表等,可用于投资研究、交易复盘、市场监控、行业分析、信用研究、财报审计、资产配置等场景,适配机构与个人多元需求。返回结果包含数据说明及 xlsx 文件。Natural language query for financial data across all markets…

    365 GitHub stars~518 tokensUpdated 3 mo ago
    Business, Finance & HRAuto-check passed
  • Mx Stocks Screener

    hiboys/ExploreFinance

    基于东方财富数据库,支持通过自然语言输入筛选A港美股、基金、债券等多种资产,支持多元指标筛选,含技术面、消息面、基本面及市场情绪等,可用于全球资产速筛、跨市场监控、投资组合构建、策略回测等场景。返回结果包含数据说明及 csv 文件。Natural language screener for investment assets across global markets, including…

    365 GitHub stars~697 tokensUpdated 3 mo ago
    Business, Finance & HRAuto-check passed

More from HKUDS/Vibe-Trading

All 89 skills in this repo
  • Eastmoney Market Data

    HKUDS/Vibe-Trading

    Index of Eastmoney's free, no-token market data interfaces for China A-shares and Hong Kong stocks: fund flows, dragon-tiger lists, margin trading, reports and news.

    35k GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • OKX Market Data

    HKUDS/Vibe-Trading

    Retrieves public OKX cryptocurrency market data such as spot prices, candlesticks, funding rates and open interest through the OKX V5 REST API, with no authentication.

    35k GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • SEC EDGAR Filings Fetcher

    HKUDS/Vibe-Trading

    Fetches U.S. SEC EDGAR data: resolves tickers to CIK numbers, lists recent 10-K, 10-Q and 8-K filings with document URLs, and pulls XBRL financial series.

    35k GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • A-Share ST Risk Screener

    HKUDS/Vibe-Trading

    Predicts whether a mainland China A-share company risks an ST or *ST warning after its next annual report, using financial thresholds and Sina penalty records.

    35k GitHub stars~4.9k tokensUpdated yesterday
    Auto-check passed
  • Breaks a structural trend such as AI infrastructure into its physical supply chain and ranks lesser-known listed companies sitting on each bottleneck.

    35k GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed
  • Plans and drafts an eight-part, roughly 120k-word investigative series on one company, built around a strict fact-check pass rather than fast drafting.

    35k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Trade Journal Analysis

What does Trade Journal Analysis do?

Reads a broker export of your trades (CSV or Excel), builds a trading profile and runs four behavior checks: disposition effect, overtrading, chasing and anchoring. You hand the agent a broker export and it calls the `analyze_trade_journal` tool, which detects the format on its own: Tonghuashun and Eastmoney A-share CSVs, Futu Hong Kong and US CSVs, or any generic CSV with datetime, symbol, side, quantity and price columns. The profile covers holding days, trade frequency, win rate, profit-and-loss ratio, cumulative profit, maximum drawdown, top symbols and the spread across markets and hours of the day.

When should I use Trade Journal Analysis?

Trade Journal Analysis fits situations like: reviewing your own trading history exported from a broker; checking a trade history for the disposition effect, overtrading, chasing or anchoring; calculating win rate, profit-loss ratio and drawdown from a trade export; narrowing an analysis to a single month, symbol or market.

How do I install Trade Journal Analysis in Claude Code?

Run `npx skills add HKUDS/Vibe-Trading --skill trade-journal -a claude-code`. Or copy the skill folder (agent/src/skills/trade-journal in HKUDS/Vibe-Trading) into .claude/skills/trade-journal in your project. Claude Code loads it when a task matches its description.

How do I install Trade Journal Analysis in Codex?

Run `npx skills add HKUDS/Vibe-Trading --skill trade-journal -a codex`. Or copy the skill folder (agent/src/skills/trade-journal in HKUDS/Vibe-Trading) into .agents/skills/trade-journal in your project. Codex loads it when a task matches its description.

Can I use Trade Journal Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/Vibe-Trading --skill trade-journal -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/trade-journal, .gemini/skills/trade-journal, .github/skills/trade-journal and .opencode/skills/trade-journal in your project.

What does Trade Journal Analysis need to run?

SKILL.md names no scripts, command-line tools or credentials: Trade Journal Analysis is instructions for the agent only. Our summary lists: A broker trade export in CSV or Excel format; The `analyze_trade_journal` tool.

Does Trade Journal Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Trade Journal Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Trade Journal Analysis use?

Trade Journal Analysis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Trade Journal Analysis use?

About 1.8k tokens (SKILL.md is roughly 7.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Trade Journal Analysis?

Skills that share tags, products or a category with Trade Journal Analysis: Anti Gambling Trader (mars-tw/anti-gambling-trader-tw, 907 stars), Data Update (Sixian-Li/plain-backtest, 204 stars), Regime (jackson-video-resources/markov-hedge-fund-method, 484 stars) and Trading212 API (trading212-labs/agent-skills, 129 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Trade Journal Analysis?

HKUDS (a GitHub organization) maintains it in HKUDS/Vibe-Trading, which has 35,097 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on October 9, 2026.

Source: HKUDS/Vibe-Trading on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.